|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdsto.dfc.commandline.Option
public abstract class Option
Representation of a command-line option
Field Summary | |
---|---|
protected String |
value
|
Constructor Summary | |
---|---|
protected |
Option(char shortForm,
String longForm,
boolean wantsValue)
|
Method Summary | |
---|---|
Object |
getValue()
|
Object |
getValue(String arg)
Returns the value of this option if the option actually has a value associated with it, or else it returns Boolean.TRUE. |
String |
longForm()
return the longForm representation of this option. |
protected Object |
parseValue(String arg)
Override to extract and convert an option value passed on the command-line |
protected void |
setValue(String value)
|
String |
shortForm()
return the shortForm representation of this option. |
boolean |
wantsValue()
Tells whether or not this option wants a value |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String value
Constructor Detail |
---|
protected Option(char shortForm, String longForm, boolean wantsValue)
shortForm
- A single character representation of the option. eg 'f' for "-f"longForm
- A string representation of the option. eg "file" for "--file"wantsValue
- If this is set to true then the option requires a value after it. eg "--file blah.txt"Method Detail |
---|
public String shortForm()
public String longForm()
public boolean wantsValue()
public final Object getValue(String arg) throws IllegalOptionValueException
IllegalOptionValueException
- This gets thrown if the arg is null.public Object getValue()
protected void setValue(String value)
protected Object parseValue(String arg) throws IllegalOptionValueException
IllegalOptionValueException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |