Class MainParser

java.lang.Object
org.basex.util.MainParser

public final class MainParser extends Object
This class parses command-line arguments provided by a class with main method.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks if the current argument starts with a dash (i.e., introduces any flags).
    boolean
    Checks if more arguments are available.
    char
    Returns the next flag.
    int
    Returns the next positive numeric argument.
    Returns the next string argument.
    Returns an exception with the command usage info.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MainParser

      public MainParser(Main main)
      Default constructor.
      Parameters:
      main - calling object
  • Method Details

    • more

      public boolean more()
      Checks if more arguments are available.
      Returns:
      result of check
    • dash

      public boolean dash()
      Checks if the current argument starts with a dash (i.e., introduces any flags).
      Returns:
      result of check
    • next

      public char next()
      Returns the next flag.
      Returns:
      next flag
    • string

      public String string()
      Returns the next string argument.
      Returns:
      string
    • number

      public int number() throws BaseXException
      Returns the next positive numeric argument.
      Returns:
      positive integer
      Throws:
      BaseXException - database exception
    • usage

      public BaseXException usage()
      Returns an exception with the command usage info.
      Returns:
      database exception