Modifier and Type | Class and Description |
---|---|
class |
AlreadySelectedException
Thrown when more than one option in an option group
has been provided.
|
class |
AmbiguousOptionException
Exception thrown when an option can't be identified from a partial name.
|
class |
MissingArgumentException
Thrown when an option requiring an argument
is not provided with an argument.
|
class |
MissingOptionException
Thrown when a required option has not been provided.
|
class |
UnrecognizedOptionException
Exception thrown during parsing signalling an unrecognized
option was seen.
|
Modifier and Type | Method and Description |
---|---|
private void |
DefaultParser.checkRequiredArgs()
Throw a
MissingArgumentException if the current option
didn't receive the number of arguments expected. |
static java.lang.Class<?> |
TypeHandler.createClass(java.lang.String classname)
Returns the class whose name is
classname . |
static java.lang.Number |
TypeHandler.createNumber(java.lang.String str)
Create a number from a String.
|
static java.lang.Object |
TypeHandler.createObject(java.lang.String classname)
Create an Object from the classname and empty constructor.
|
static java.net.URL |
TypeHandler.createURL(java.lang.String str)
Returns the URL represented by
str . |
static java.lang.Object |
TypeHandler.createValue(java.lang.String str,
java.lang.Class<?> clazz)
Returns the
Object of type clazz
with the value of str . |
static java.lang.Object |
TypeHandler.createValue(java.lang.String str,
java.lang.Object obj)
Returns the
Object of type obj
with the value of str . |
protected abstract java.lang.String[] |
Parser.flatten(Options opts,
java.lang.String[] arguments,
boolean stopAtNonOption)
Deprecated.
Subclasses must implement this method to reduce
the
arguments that have been passed to the parse method. |
protected java.lang.String[] |
PosixParser.flatten(Options options,
java.lang.String[] arguments,
boolean stopAtNonOption)
Deprecated.
|
java.lang.Object |
CommandLine.getParsedOptionValue(java.lang.String opt)
Return a version of this
Option converted to a particular type. |
protected void |
DefaultParser.handleConcatenatedOptions(java.lang.String token)
Breaks
token into its constituent parts
using the following algorithm. |
private void |
DefaultParser.handleLongOption(java.lang.String token)
Handles the following tokens:
--L
--L=V
--L V
--l
|
private void |
DefaultParser.handleLongOptionWithEqual(java.lang.String token)
Handles the following tokens:
--L=V
-L=V
--l=V
-l=V
|
private void |
DefaultParser.handleLongOptionWithoutEqual(java.lang.String token)
Handles the following tokens:
--L
-L
--l
-l
|
private void |
DefaultParser.handleOption(Option option) |
private void |
DefaultParser.handleProperties(java.util.Properties properties)
Sets the values of Options using the values in
properties . |
private void |
DefaultParser.handleShortAndLongOption(java.lang.String token)
Handles the following tokens:
-S
-SV
-S V
-S=V
-S1S2
-S1S2 V
-SV1=V2
-L
-LV
-L V
-L=V
-l
|
private void |
DefaultParser.handleToken(java.lang.String token)
Handle any command line token.
|
private void |
DefaultParser.handleUnknownToken(java.lang.String token)
Handles an unknown token.
|
CommandLine |
CommandLineParser.parse(Options options,
java.lang.String[] arguments)
Parse the arguments according to the specified options.
|
CommandLine |
DefaultParser.parse(Options options,
java.lang.String[] arguments) |
CommandLine |
Parser.parse(Options options,
java.lang.String[] arguments)
Deprecated.
Parses the specified
arguments based
on the specified Options . |
CommandLine |
CommandLineParser.parse(Options options,
java.lang.String[] arguments,
boolean stopAtNonOption)
Parse the arguments according to the specified options.
|
CommandLine |
DefaultParser.parse(Options options,
java.lang.String[] arguments,
boolean stopAtNonOption) |
CommandLine |
Parser.parse(Options options,
java.lang.String[] arguments,
boolean stopAtNonOption)
Deprecated.
Parses the specified
arguments
based on the specified Options . |
CommandLine |
DefaultParser.parse(Options options,
java.lang.String[] arguments,
java.util.Properties properties)
Parse the arguments according to the specified options and properties.
|
CommandLine |
Parser.parse(Options options,
java.lang.String[] arguments,
java.util.Properties properties)
Deprecated.
Parse the arguments according to the specified options and properties.
|
CommandLine |
DefaultParser.parse(Options options,
java.lang.String[] arguments,
java.util.Properties properties,
boolean stopAtNonOption)
Parse the arguments according to the specified options and properties.
|
CommandLine |
Parser.parse(Options options,
java.lang.String[] arguments,
java.util.Properties properties,
boolean stopAtNonOption)
Deprecated.
Parse the arguments according to the specified options and
properties.
|
void |
Parser.processArgs(Option opt,
java.util.ListIterator<java.lang.String> iter)
Deprecated.
Process the argument values for the specified Option
opt using the values retrieved from the
specified iterator iter . |
protected void |
Parser.processOption(java.lang.String arg,
java.util.ListIterator<java.lang.String> iter)
Deprecated.
Process the Option specified by
arg using the values
retrieved from the specified iterator iter . |
protected void |
Parser.processProperties(java.util.Properties properties)
Deprecated.
Sets the values of Options using the values in
properties . |
private void |
Parser.updateRequiredOptions(Option opt)
Deprecated.
Removes the option or its group from the list of expected elements.
|