|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.cli2.commandline.CommandLineImpl
org.apache.commons.cli2.commandline.DefaultingCommandLine
public class DefaultingCommandLine
Manages a queue of default CommandLines. This CommandLine implementation is backed by a queue of CommandLine instances which are queried in turn until a suitable result is found. CommandLine instances can either be added to the back of the queue or can be pushed in at a specific position.
appendCommandLine(CommandLine),
insertCommandLine(int, CommandLine)| Constructor Summary | |
|---|---|
DefaultingCommandLine()
|
|
| Method Summary | |
|---|---|
void |
appendCommandLine(CommandLine commandLine)
Adds a CommandLine instance to the back of the queue. |
Iterator |
commandLines()
Builds an iterator over the build in CommandLines. |
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 the default property option |
Set |
getProperties(Option option)
Retrieves the set of all property names associated with this option |
String |
getProperty(Option option,
String property,
String defaultValue)
Retrieves the value associated with the specified property |
String |
getProperty(String property)
Retrieves the value associated with the specified property for the default property set |
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. |
void |
insertCommandLine(int index,
CommandLine commandLine)
Adds a CommandLine instance to a specified position in the queue. |
| Methods inherited from class org.apache.commons.cli2.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, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultingCommandLine()
| Method Detail |
|---|
public void appendCommandLine(CommandLine commandLine)
commandLine - the default values to use if all CommandLines
public void insertCommandLine(int index,
CommandLine commandLine)
index - ths position at which to insertcommandLine - the CommandLine to insertpublic Iterator commandLines()
public Option getOption(String trigger)
CommandLine
trigger - the name of the option to retrieve
public List getOptions()
CommandLine
public Set getOptionTriggers()
CommandLine
public boolean hasOption(Option option)
CommandLine
option - the Option to search for
public List getValues(Option option,
List defaultValues)
CommandLine
option - the Option associated with the valuesdefaultValues - the result to return if no values are found
public Boolean getSwitch(Option option,
Boolean defaultValue)
CommandLine
option - the Option associated with the valuedefaultValue - the Boolean to use if none match
public String getProperty(String property)
CommandLine
property - the property name to lookup
public String getProperty(Option option,
String property,
String defaultValue)
CommandLine
option - the option i.e., -Dproperty - the property name to lookupdefaultValue - the value to use if no other is found
public Set getProperties(Option option)
CommandLine
option - the option i.e., -D
public Set getProperties()
CommandLine
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||