protected class Options.FlagOptionDef extends Options.OptionDef
mDefaultValues, mNumValuesNeeded
Constructor and Description |
---|
FlagOptionDef(String name,
String desc)
Construct a flag option.
|
Modifier and Type | Method and Description |
---|---|
String |
getString(String[] values,
int i)
Return the ith value for the option as a boolean.
|
void |
validateOption(ArrayList values)
Ensure that the option does not have any values.
|
getBigDecimal, getBoolean, getDate, getDefaultValues, getDesc, getInteger, getIthDefaultAsString, getName, getNumValuesNeeded, getStrings, isRequiredOption, toString
public FlagOptionDef(String name, String desc)
name
- The name of the option. The name should include
the leading "-" (i.e. "-verbose").desc
- The description of the option.public void validateOption(ArrayList values) throws CommandLineParser.OptionDataException
validateOption
in class Options.OptionDef
values
- An array that contains the values that were specified
on the command line for the option. If no values were specified
then the array will be empty.OptionDataException
- One or more values followed
this option.CommandLineParser.OptionDataException
public String getString(String[] values, int i) throws CommandLineParser.OptionDataException
getString
in class Options.OptionDef
values
- The array of values retrieved from the command
line for the option.i
- The index of the value to return. The index is zero
relative (i.e. a value of zero implies the first value). This
method only makes senses for an index of zero.OptionDataException
- The value for i is not zero.CommandLineParser.OptionDataException
Copyright © 2003, 2023, Oracle and/or its affiliates.