Package jargs.gnu
Class CmdLineParser.Option
java.lang.Object
jargs.gnu.CmdLineParser.Option
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
CmdLineParser.Option.BooleanOption
,CmdLineParser.Option.DoubleOption
,CmdLineParser.Option.IntegerOption
,CmdLineParser.Option.LongOption
,CmdLineParser.Option.StringOption
- Enclosing class:
CmdLineParser
Representation of a command-line option.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
The Class BooleanOption.static class
An option that expects a floating-point value.static class
An option that expects an integer value.static class
An option that expects a long integer value.static class
An option that expects a string value. -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Option
Instantiates a new option.- Parameters:
longForm
- the long formwantsValue
- the wants value
-
Option
Instantiates a new option.- Parameters:
shortForm
- the short formlongForm
- the long formwantsValue
- the wants value
-
-
Method Details
-
shortForm
-
longForm
-
wantsValue
public boolean wantsValue()Tells whether or not this option wants a value.- Returns:
- true, if successful
-
getValue
public final Object getValue(String arg, Locale locale) throws CmdLineParser.IllegalOptionValueException Gets the value.- Parameters:
arg
- the arglocale
- the locale- Returns:
- the value
- Throws:
CmdLineParser.IllegalOptionValueException
- the illegal option value exception
-
parseValue
protected Object parseValue(String arg, Locale locale) throws CmdLineParser.IllegalOptionValueException Override to extract and convert an option value passed on the command-line.- Parameters:
arg
- the arglocale
- the locale- Returns:
- the object
- Throws:
CmdLineParser.IllegalOptionValueException
- the illegal option value exception
-