public abstract static class CmdLineParser.Option extends Object implements Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
CmdLineParser.Option.BooleanOption
The Class BooleanOption.
|
static class |
CmdLineParser.Option.DoubleOption
An option that expects a floating-point value.
|
static class |
CmdLineParser.Option.IntegerOption
An option that expects an integer value.
|
static class |
CmdLineParser.Option.LongOption
An option that expects a long integer value.
|
static class |
CmdLineParser.Option.StringOption
An option that expects a string value.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Option(char shortForm,
String longForm,
boolean wantsValue)
Instantiates a new option.
|
protected |
Option(String longForm,
boolean wantsValue)
Instantiates a new option.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
getValue(String arg,
Locale locale)
Gets the value.
|
String |
longForm()
Long form.
|
protected Object |
parseValue(String arg,
Locale locale)
Override to extract and convert an option value passed on the command-line.
|
String |
shortForm()
Short form.
|
boolean |
wantsValue()
Tells whether or not this option wants a value.
|
protected Option(String longForm, boolean wantsValue)
longForm - the long formwantsValue - the wants valueprotected Option(char shortForm,
String longForm,
boolean wantsValue)
shortForm - the short formlongForm - the long formwantsValue - the wants valuepublic String shortForm()
public String longForm()
public boolean wantsValue()
public final Object getValue(String arg, Locale locale) throws CmdLineParser.IllegalOptionValueException
arg - the arglocale - the localeCmdLineParser.IllegalOptionValueException - the illegal option value exceptionprotected Object parseValue(String arg, Locale locale) throws CmdLineParser.IllegalOptionValueException
arg - the arglocale - the localeCmdLineParser.IllegalOptionValueException - the illegal option value exceptionCopyright © 2009–2016 Jeremy Landis. All rights reserved.