Package org.basex.util
Class MainParser
java.lang.Object
org.basex.util.MainParser
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 -
Method Summary
Modifier and TypeMethodDescriptionbooleandash()Checks if the current argument starts with a dash (i.e., introduces any flags).booleanmore()Checks if more arguments are available.charnext()Returns the next flag.intnumber()Returns the next positive numeric argument.string()Returns the next string argument.usage()Returns an exception with the command usage info.
-
Constructor Details
-
MainParser
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
Returns the next string argument.- Returns:
- string
-
number
Returns the next positive numeric argument.- Returns:
- positive integer
- Throws:
BaseXException- database exception
-
usage
Returns an exception with the command usage info.- Returns:
- database exception
-