Class CommandParser

java.lang.Object
org.basex.core.parse.CommandParser

public abstract class CommandParser extends Object
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-21, BSD License, Christian Gruen
  • Method Details

    • get

      public static CommandParser get(String input, Context ctx)
      Constructor.
      Parameters:
      input - input
      ctx - context
      Returns:
      command parser
    • pwReader

      public final CommandParser pwReader(PasswordReader pr)
      Attaches a password reader.
      Parameters:
      pr - password reader
      Returns:
      self reference
    • baseURI

      public final CommandParser baseURI(String base)
      Attaches a base URI.
      Parameters:
      base - base URI
      Returns:
      self reference
    • suggest

      public final CommandParser suggest()
      XQuery suggestions.
      Returns:
      self reference
    • parseSingle

      public final Command parseSingle() throws QueryException
      Restricts parsing to a single command.
      Returns:
      self reference
      Throws:
      QueryException - query exception
    • parse

      public final Command[] parse() throws QueryException
      Parses the input and returns a command list.
      Returns:
      commands
      Throws:
      QueryException - query exception
    • parse

      protected abstract void parse(ArrayList<Command> cmds) throws QueryException
      Parses the input and fills the command list.
      Parameters:
      cmds - container for created commands
      Throws:
      QueryException - query exception