public class WriteableCommandLineImpl extends CommandLineImpl implements WriteableCommandLine
| Constructor and Description |
|---|
WriteableCommandLineImpl(Option rootOption,
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)
Adds an Option to the CommandLine
|
void |
addProperty(Option option,
String property,
String value)
Adds a property value to a name in the CommandLine.
|
void |
addProperty(String property,
String value)
Adds a property value to the default property set.
|
void |
addSwitch(Option option,
boolean value)
Adds a switch value to an Option in the CommandLine.
|
void |
addValue(Option option,
Object value)
Adds a value to an Option in the CommandLine.
|
Option |
getCurrentOption()
Returns the option that is currently processed.
|
List |
getNormalised() |
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 |
getUndefaultedValues(Option option)
Retrieves the Argument values specified on the command line for the
specified Option, this doesn't return any values supplied
programmatically as defaults.
|
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)
Tests whether the passed in trigger looks like an option.
|
void |
setCurrentOption(Option currentOption)
Sets the current option.
|
void |
setDefaultSwitch(Option option,
Boolean defaultSwitch)
Sets the default state for a Switch in the CommandLine.
|
void |
setDefaultValues(Option option,
List defaults)
Sets the default values for an Option in the CommandLine
|
String |
toString() |
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, List arguments)
rootOption - the CommandLine's root Optionarguments - the arguments this CommandLine representspublic Option getCurrentOption()
WriteableCommandLinegetCurrentOption in interface WriteableCommandLinepublic void setCurrentOption(Option currentOption)
WriteableCommandLinesetCurrentOption in interface WriteableCommandLinecurrentOption - the new current optionpublic void addOption(Option option)
WriteableCommandLineaddOption in interface WriteableCommandLineoption - the Option to addpublic void addValue(Option option, Object value)
WriteableCommandLineaddValue in interface WriteableCommandLineoption - the Option to add tovalue - the value to addpublic void addSwitch(Option option, boolean value)
WriteableCommandLineaddSwitch in interface WriteableCommandLineoption - the Option to add tovalue - the switch value to addpublic boolean hasOption(Option option)
CommandLinehasOption in interface CommandLineoption - the Option to search forpublic Option getOption(String trigger)
CommandLinegetOption in interface CommandLinetrigger - the name of the option to retrievepublic List getValues(Option option, List defaultValues)
CommandLinegetValues in interface CommandLineoption - the Option associated with the valuesdefaultValues - the result to return if no values are foundpublic List getUndefaultedValues(Option option)
WriteableCommandLinegetUndefaultedValues in interface WriteableCommandLineoption - the Option associated with the valuespublic Boolean getSwitch(Option option, Boolean defaultValue)
CommandLinegetSwitch in interface CommandLineoption - the Option associated with the valuedefaultValue - the Boolean to use if none matchpublic String getProperty(String property)
CommandLinegetProperty in interface CommandLineproperty - the property name to lookuppublic void addProperty(Option option, String property, String value)
WriteableCommandLineaddProperty in interface WriteableCommandLineoption - the Option to add toproperty - the name of the propertyvalue - the value of the propertypublic void addProperty(String property, String value)
WriteableCommandLineaddProperty in interface WriteableCommandLineproperty - the name of the propertyvalue - the value of the propertypublic String getProperty(Option option, String property, String defaultValue)
CommandLinegetProperty in interface CommandLineoption - the option i.e., -Dproperty - the property name to lookupdefaultValue - the value to use if no other is foundpublic Set getProperties(Option option)
CommandLinegetProperties in interface CommandLineoption - the option i.e., -Dpublic Set getProperties()
CommandLinegetProperties in interface CommandLinepublic boolean looksLikeOption(String trigger)
looksLikeOption in interface WriteableCommandLinetrigger - the command line element to testpublic List getOptions()
CommandLinegetOptions in interface CommandLinepublic Set getOptionTriggers()
CommandLinegetOptionTriggers in interface CommandLinepublic void setDefaultValues(Option option, List defaults)
WriteableCommandLinesetDefaultValues in interface WriteableCommandLineoption - the Option to add todefaults - the defaults for the optionpublic void setDefaultSwitch(Option option, Boolean defaultSwitch)
WriteableCommandLinesetDefaultSwitch in interface WriteableCommandLineoption - the Option to add todefaultSwitch - the defaults state for ths switchpublic List getNormalised()
Copyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.