|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.dpml.cli.option.OptionImpl
net.dpml.cli.option.PropertyOption
public class PropertyOption
Handles the java style "-Dprop=value" opions
Field Summary | |
---|---|
static String |
DEFAULT_DESCRIPTION
The default property option description. |
static String |
DEFAULT_OPTION_STRING
The default property option name. |
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 net.dpml.cli.option.OptionImpl |
---|
canProcess, checkPrefixes, defaults, equals, findOption, getId, hashCode, isRequired, 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 OptionMethod Detail |
---|
public boolean canProcess(WriteableCommandLine commandLine, String argument)
commandLine
- the CommandLine object to store defaults inargument
- the argument to be tested
public Set getPrefixes()
public void process(WriteableCommandLine commandLine, ListIterator arguments) throws OptionException
commandLine
- the CommandLine object to store results inarguments
- the arguments to process
OptionException
- if any problems occurpublic Set getTriggers()
public void validate(WriteableCommandLine commandLine) throws OptionException
commandLine
- the CommandLine to check.
OptionException
- if the CommandLine is not valid.public void appendUsage(StringBuffer buffer, Set helpSettings, Comparator comp)
buffer
- the buffer to append tohelpSettings
- a set of display settings @see DisplaySettingcomp
- a comparator used to sort the Optionspublic String getPreferredName()
public String getDescription()
HelpFormatter
public List helpLines(int depth, Set helpSettings, Comparator comp)
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 |