org.basex.core.parse
Class CommandParser

java.lang.Object
  extended by org.basex.util.InputParser
      extended by org.basex.core.parse.CommandParser

public final class CommandParser
extends InputParser

This is a parser for command strings, creating Command instances. Several commands can be formulated in one string and separated by semicolons.

Author:
BaseX Team 2005-12, BSD License, Christian Gruen

Field Summary
 org.basex.core.parse.CmdParser parser
          Context.
 
Fields inherited from class org.basex.util.InputParser
file, input, length, mark, pos
 
Constructor Summary
CommandParser(java.lang.String in, Context c)
          Constructor.
 
Method Summary
 Command[] parse()
          Parses the input and returns a command list.
 Command parseSingle()
          Parses the input as single command and returns the resulting command.
 CommandParser pwReader(PasswordReader pr)
          Attaches a password reader.
 Command[] suggest()
          Parses the input and creates command completions on the way.
 
Methods inherited from class org.basex.util.InputParser
consume, consume, consume, curr, curr, file, found, info, mark, more, next, quote, rest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parser

public final org.basex.core.parse.CmdParser parser
Context.

Constructor Detail

CommandParser

public CommandParser(java.lang.String in,
                     Context c)
Constructor.

Parameters:
in - input
c - context
Method Detail

pwReader

public CommandParser pwReader(PasswordReader pr)
Attaches a password reader.

Parameters:
pr - password reader
Returns:
self reference

parseSingle

public Command parseSingle()
                    throws QueryException
Parses the input as single command and returns the resulting command.

Returns:
command
Throws:
QueryException - query exception

parse

public Command[] parse()
                throws QueryException
Parses the input and returns a command list.

Returns:
commands
Throws:
QueryException - query exception

suggest

public Command[] suggest()
                  throws QueryException
Parses the input and creates command completions on the way.

Returns:
commands
Throws:
QueryException - query exception