public class WriteableCommandLineImpl extends CommandLineImpl implements WriteableCommandLine
| Constructor and Description |
|---|
WriteableCommandLineImpl(Option rootOption,
java.util.List arguments)
Creates a new WriteableCommandLineImpl rooted on the specified Option, to
hold the parsed arguments.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addOption(Option option)
Add an option.
|
void |
addProperty(java.lang.String property,
java.lang.String value)
Add a property to the commandline.
|
void |
addSwitch(Option option,
boolean value)
Add a switch.
|
void |
addValue(Option option,
java.lang.Object value)
Add an option.
|
java.util.List |
getNormalised()
Return the normalized collection.
|
Option |
getOption(java.lang.String trigger)
Finds the Option with the specified trigger
|
java.util.List |
getOptions()
Retrieves a list of all Options found in this CommandLine
|
java.util.Set |
getOptionTriggers()
Retrieves a list of all Option triggers found in this CommandLine
|
java.util.Set |
getProperties()
Retrieves the set of all property names associated with this CommandLine
|
java.lang.String |
getProperty(java.lang.String property,
java.lang.String defaultValue)
Retrieves the value associated with the specified property
|
java.lang.Boolean |
getSwitch(Option option,
java.lang.Boolean defaultValue)
Retrieves the Boolean value associated with the specified Switch
|
java.util.List |
getValues(Option option,
java.util.List defaultValues)
Retrieves the Argument values associated with the specified Option
|
boolean |
hasOption(Option option)
Detects the presence of an option in this CommandLine.
|
boolean |
looksLikeOption(java.lang.String trigger)
Return true if the trigger argument looks like an option.
|
void |
setDefaultSwitch(Option option,
java.lang.Boolean defaultSwitch)
Set default switch.
|
void |
setDefaultValues(Option option,
java.util.List defaults)
Set default values.
|
java.lang.String |
toString()
Return this commandline as a string.
|
getOptionCount, getOptionCount, getProperty, getSwitch, getSwitch, getSwitch, getValue, getValue, getValue, getValue, getValues, getValues, getValues, hasOptionclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetOptionCount, getOptionCount, getProperty, getSwitch, getSwitch, getSwitch, getValue, getValue, getValue, getValue, getValues, getValues, getValues, hasOptionpublic WriteableCommandLineImpl(Option rootOption, java.util.List arguments)
rootOption - the CommandLine's root Optionarguments - the arguments this CommandLine representspublic void addOption(Option option)
addOption in interface WriteableCommandLineoption - the option to addpublic void addValue(Option option, java.lang.Object value)
addValue in interface WriteableCommandLineoption - the option to addvalue - the option valuepublic void addSwitch(Option option, boolean value)
addSwitch in interface WriteableCommandLineoption - the option to addvalue - the option valuepublic boolean hasOption(Option option)
hasOption in interface CommandLineoption - the Option to search forpublic Option getOption(java.lang.String trigger)
getOption in interface CommandLinetrigger - the name of the option to retrievepublic java.util.List getValues(Option option, java.util.List defaultValues)
getValues in interface CommandLineoption - the Option associated with the valuesdefaultValues - the result to return if no values are foundpublic java.lang.Boolean getSwitch(Option option, java.lang.Boolean defaultValue)
getSwitch in interface CommandLineoption - the Option associated with the valuedefaultValue - the Boolean to use if none matchpublic void addProperty(java.lang.String property, java.lang.String value)
addProperty in interface WriteableCommandLineproperty - the property namevalue - the property valuepublic java.lang.String getProperty(java.lang.String property, java.lang.String defaultValue)
getProperty in interface CommandLineproperty - the property name to lookupdefaultValue - the value to use if no other is foundpublic java.util.Set getProperties()
getProperties in interface CommandLinepublic boolean looksLikeOption(java.lang.String trigger)
looksLikeOption in interface WriteableCommandLinetrigger - the trigger to evaluatepublic java.lang.String toString()
toString in class java.lang.Objectpublic java.util.List getOptions()
getOptions in interface CommandLinepublic java.util.Set getOptionTriggers()
getOptionTriggers in interface CommandLinepublic void setDefaultValues(Option option, java.util.List defaults)
setDefaultValues in interface WriteableCommandLineoption - the optiondefaults - a list of defaultspublic void setDefaultSwitch(Option option, java.lang.Boolean defaultSwitch)
setDefaultSwitch in interface WriteableCommandLineoption - the optiondefaultSwitch - the default switch statepublic java.util.List getNormalised()