|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.cli2.option.OptionImpl
org.apache.commons.cli2.option.PropertyOption
public class PropertyOption
Handles the java style "-Dprop=value" opions
| Field Summary | |
|---|---|
static String |
DEFAULT_DESCRIPTION
|
static String |
DEFAULT_OPTION_STRING
|
static PropertyOption |
INSTANCE
A default PropertyOption instance |
| Constructor Summary | |
|---|---|
PropertyOption()
Creates a new PropertyOption using the default settings of a "-D" trigger and an id of 'D' |
|
PropertyOption(String optionString,
String description,
int id)
Creates a new PropertyOption using the specified parameters |
|
| Method Summary | |
|---|---|
void |
appendUsage(StringBuffer buffer,
Set helpSettings,
Comparator comp)
Appends usage information to the specified StringBuffer |
boolean |
canProcess(WriteableCommandLine commandLine,
String argument)
Indicates whether this Option will be able to process the particular argument. |
String |
getDescription()
Returns a description of the option. |
String |
getPreferredName()
The preferred name of an option is used for generating help and usage information. |
Set |
getPrefixes()
Identifies the argument prefixes that should be considered options. |
Set |
getTriggers()
Identifies the argument prefixes that should trigger this option. |
List |
helpLines(int depth,
Set helpSettings,
Comparator comp)
Builds up a list of HelpLineImpl instances to be presented by HelpFormatter. |
void |
process(WriteableCommandLine commandLine,
ListIterator arguments)
Processes String arguments into a CommandLine. |
void |
validate(WriteableCommandLine commandLine)
Checks that the supplied CommandLine is valid with respect to this option. |
| Methods inherited from class org.apache.commons.cli2.option.OptionImpl |
|---|
canProcess, checkPrefixes, defaults, equals, findOption, getId, getParent, hashCode, isRequired, setParent, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_OPTION_STRING
public static final String DEFAULT_DESCRIPTION
public static final PropertyOption INSTANCE
| Constructor Detail |
|---|
public PropertyOption()
public PropertyOption(String optionString,
String description,
int id)
optionString - the trigger for the Optiondescription - the description of the Optionid - the id of the Option| Method Detail |
|---|
public boolean canProcess(WriteableCommandLine commandLine,
String argument)
Option
commandLine - The CommandLine to checkargument - The argument to be tested
public Set getPrefixes()
Option
public void process(WriteableCommandLine commandLine,
ListIterator arguments)
throws OptionException
Option
commandLine - The CommandLine object to store results inarguments - The arguments to process
OptionException - if any problems occurpublic Set getTriggers()
Option
public void validate(WriteableCommandLine commandLine)
Option
commandLine - The CommandLine to check.
public void appendUsage(StringBuffer buffer,
Set helpSettings,
Comparator comp)
Option
buffer - the buffer to append tohelpSettings - a set of display settings @see DisplaySettingcomp - a comparator used to sort the Optionspublic String getPreferredName()
Option
public String getDescription()
Option
HelpFormatter
public List helpLines(int depth,
Set helpSettings,
Comparator comp)
Option
depth - the initial indent depthhelpSettings - the HelpSettings that should be appliedcomp - a comparator used to sort options when applicable.
HelpLine,
HelpFormatter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||