|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.dpml.cli.commandline.CommandLineImpl
net.dpml.cli.commandline.WriteableCommandLineImpl
A WriteableCommandLine implementation allowing Options to write their processed information to a CommandLine.
| Constructor Summary | |
WriteableCommandLineImpl(Option rootOption,
List arguments)
Creates a new WriteableCommandLineImpl rooted on the specified Option, to hold the parsed arguments. |
|
| Method Summary | |
void |
addOption(Option option)
Add an option. |
void |
addProperty(String property,
String value)
Add a property to the commandline. |
void |
addSwitch(Option option,
boolean value)
Add a switch. |
void |
addValue(Option option,
Object value)
Add an option. |
List |
getNormalised()
Return the normalized collection. |
Option |
getOption(String trigger)
Finds the Option with the specified trigger |
List |
getOptions()
Retrieves a list of all Options found in this CommandLine |
Set |
getOptionTriggers()
Retrieves a list of all Option triggers found in this CommandLine |
Set |
getProperties()
Retrieves the set of all property names associated with this CommandLine |
String |
getProperty(String property,
String defaultValue)
Retrieves the value associated with the specified property |
Boolean |
getSwitch(Option option,
Boolean defaultValue)
Retrieves the Boolean value associated with the specified Switch |
List |
getValues(Option option,
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(String trigger)
Return true if the trigger argument looks like an option. |
void |
setDefaultSwitch(Option option,
Boolean defaultSwitch)
Set default switch. |
void |
setDefaultValues(Option option,
List defaults)
Set default values. |
String |
toString()
Return this commandline as a string. |
| Methods inherited from class net.dpml.cli.commandline.CommandLineImpl |
getOptionCount, getOptionCount, getProperty, getSwitch, getSwitch, getSwitch, getValue, getValue, getValue, getValue, getValues, getValues, getValues, hasOption |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface net.dpml.cli.CommandLine |
getOptionCount, getOptionCount, getProperty, getSwitch, getSwitch, getSwitch, getValue, getValue, getValue, getValue, getValues, getValues, getValues, hasOption |
| Constructor Detail |
public WriteableCommandLineImpl(Option rootOption,
List arguments)
rootOption - the CommandLine's root Optionarguments - the arguments this CommandLine represents| Method Detail |
public void addOption(Option option)
addOption in interface WriteableCommandLineoption - the option to add
public void addValue(Option option,
Object value)
addValue in interface WriteableCommandLineoption - the option to addvalue - the option value
public 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 for
public Option getOption(String trigger)
getOption in interface CommandLinetrigger - the name of the option to retrieve
public List getValues(Option option,
List defaultValues)
getValues in interface CommandLineoption - the Option associated with the valuesdefaultValues - the result to return if no values are found
public Boolean getSwitch(Option option,
Boolean defaultValue)
getSwitch in interface CommandLineoption - the Option associated with the valuedefaultValue - the Boolean to use if none match
public void addProperty(String property,
String value)
addProperty in interface WriteableCommandLineproperty - the property namevalue - the property value
public String getProperty(String property,
String defaultValue)
getProperty in interface CommandLineproperty - the property name to lookupdefaultValue - the value to use if no other is found
public Set getProperties()
getProperties in interface CommandLinepublic boolean looksLikeOption(String trigger)
looksLikeOption in interface WriteableCommandLinetrigger - the trigger to evaluate
public String toString()
public List getOptions()
getOptions in interface CommandLinepublic Set getOptionTriggers()
getOptionTriggers in interface CommandLine
public void setDefaultValues(Option option,
List defaults)
setDefaultValues in interface WriteableCommandLineoption - the optiondefaults - a list of defaults
public void setDefaultSwitch(Option option,
Boolean defaultSwitch)
setDefaultSwitch in interface WriteableCommandLineoption - the optiondefaultSwitch - the default switch statepublic List getNormalised()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||