|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Instances of CommandLine represent a command line that has been processed according to the definition supplied to the parser.
Method Summary | |
Option |
getOption(String trigger)
Finds the Option with the specified trigger |
int |
getOptionCount(Option option)
Retrieves the number of times the specified Option appeared in this CommandLine |
int |
getOptionCount(String trigger)
Retrieves the number of times the specified Option appeared in this CommandLine |
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)
Retrieves the value associated with the specified property |
String |
getProperty(String property,
String defaultValue)
Retrieves the value associated with the specified property |
Boolean |
getSwitch(Option option)
Retrieves the Boolean value associated with the specified Switch |
Boolean |
getSwitch(Option option,
Boolean defaultValue)
Retrieves the Boolean value associated with the specified Switch |
Boolean |
getSwitch(String trigger)
Retrieves the Boolean value associated with the specified Switch |
Boolean |
getSwitch(String trigger,
Boolean defaultValue)
Retrieves the Boolean value associated with the specified Switch |
Object |
getValue(Option option)
Retrieves the single Argument value associated with the specified Option |
Object |
getValue(Option option,
Object defaultValue)
Retrieves the single Argument value associated with the specified Option |
Object |
getValue(String trigger)
Retrieves the single Argument value associated with the specified Option |
Object |
getValue(String trigger,
Object defaultValue)
Retrieves the single Argument value associated with the specified Option |
List |
getValues(Option option)
Retrieves the Argument values associated with the specified Option |
List |
getValues(Option option,
List defaultValues)
Retrieves the Argument values associated with the specified Option |
List |
getValues(String trigger)
Retrieves the Argument values associated with the specified Option |
List |
getValues(String trigger,
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 |
hasOption(String trigger)
Detects the presence of an option with the specified trigger in this CommandLine. |
Method Detail |
public boolean hasOption(String trigger)
trigger
- the trigger to search for
public boolean hasOption(Option option)
option
- the Option to search for
public Option getOption(String trigger)
trigger
- the name of the option to retrieve
public List getValues(String trigger)
trigger
- a trigger used to lookup the Option
public List getValues(String trigger, List defaultValues)
trigger
- a trigger used to lookup the OptiondefaultValues
- the result to return if no values are found
public List getValues(Option option)
option
- the Option associated with the values
public List getValues(Option option, List defaultValues)
option
- the Option associated with the valuesdefaultValues
- the result to return if no values are found
public Object getValue(String trigger) throws IllegalStateException
trigger
- a trigger used to lookup the Option
IllegalStateException
- if more than one values are foundpublic Object getValue(String trigger, Object defaultValue) throws IllegalStateException
trigger
- a trigger used to lookup the OptiondefaultValue
- the result to use if no values are found
IllegalStateException
- if more than one values are foundpublic Object getValue(Option option) throws IllegalStateException
option
- the Option associated with the value
IllegalStateException
- if more than one values are foundpublic Object getValue(Option option, Object defaultValue) throws IllegalStateException
option
- the Option associated with the valuedefaultValue
- the result to use if no values are found
IllegalStateException
- if more than one values are foundpublic Boolean getSwitch(String trigger)
trigger
- a trigger used to lookup the Option
public Boolean getSwitch(String trigger, Boolean defaultValue)
trigger
- a trigger used to lookup the OptiondefaultValue
- the Boolean to use if none match
public Boolean getSwitch(Option option)
option
- the Option associated with the value
public Boolean getSwitch(Option option, Boolean defaultValue)
option
- the Option associated with the valuedefaultValue
- the Boolean to use if none match
public String getProperty(String property)
property
- the property name to lookup
public String getProperty(String property, String defaultValue)
property
- the property name to lookupdefaultValue
- the value to use if no other is found
public Set getProperties()
public int getOptionCount(String trigger)
trigger
- a trigger used to lookup the Option
public int getOptionCount(Option option)
option
- the Option associated to check
public List getOptions()
public Set getOptionTriggers()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |