|
||||||||||
| 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 java.lang.String |
DEFAULT_DESCRIPTION
The default property option description. |
static java.lang.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(java.lang.String optionString,
java.lang.String description,
int id)
Creates a new PropertyOption using the specified parameters |
|
| Method Summary | |
|---|---|
void |
appendUsage(java.lang.StringBuffer buffer,
java.util.Set helpSettings,
java.util.Comparator comp)
Appends usage information to the specified StringBuffer |
boolean |
canProcess(WriteableCommandLine commandLine,
java.lang.String argument)
Indicates whether this Option will be able to process the particular argument. |
java.lang.String |
getDescription()
Returns a description of the option. |
java.lang.String |
getPreferredName()
The preferred name of an option is used for generating help and usage information. |
java.util.Set |
getPrefixes()
Identifies the argument prefixes that should be considered options. |
java.util.Set |
getTriggers()
Identifies the argument prefixes that should trigger this option. |
java.util.List |
helpLines(int depth,
java.util.Set helpSettings,
java.util.Comparator comp)
Builds up a list of HelpLineImpl instances to be presented by HelpFormatter. |
void |
process(WriteableCommandLine commandLine,
java.util.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 java.lang.String DEFAULT_OPTION_STRING
public static final java.lang.String DEFAULT_DESCRIPTION
public static final PropertyOption INSTANCE
| Constructor Detail |
|---|
public PropertyOption()
public PropertyOption(java.lang.String optionString,
java.lang.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,
java.lang.String argument)
commandLine - the CommandLine object to store defaults inargument - the argument to be tested
public java.util.Set getPrefixes()
public void process(WriteableCommandLine commandLine,
java.util.ListIterator arguments)
throws OptionException
commandLine - the CommandLine object to store results inarguments - the arguments to process
OptionException - if any problems occurpublic java.util.Set getTriggers()
public void validate(WriteableCommandLine commandLine)
throws OptionException
commandLine - the CommandLine to check.
OptionException - if the CommandLine is not valid.
public void appendUsage(java.lang.StringBuffer buffer,
java.util.Set helpSettings,
java.util.Comparator comp)
buffer - the buffer to append tohelpSettings - a set of display settings @see DisplaySettingcomp - a comparator used to sort the Optionspublic java.lang.String getPreferredName()
public java.lang.String getDescription()
HelpFormatter
public java.util.List helpLines(int depth,
java.util.Set helpSettings,
java.util.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 | |||||||||