Package org.basex.util
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-23, BSD License, Christian Gruen
-
-
Constructor Summary
Constructors Constructor Description MainParser(Main main)
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
dash()
Checks if the current argument starts with a dash (i.e., introduces any flags).boolean
more()
Checks if more arguments are available.char
next()
Returns the next flag.int
number()
Returns the next positive numeric argument.String
string()
Returns the next string argument.BaseXException
usage()
Returns an exception with the command usage info.
-
-
-
Constructor Detail
-
MainParser
public MainParser(Main main)
Default constructor.- Parameters:
main
- calling object
-
-
Method Detail
-
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
-
-