public class PropertyOption extends OptionImpl
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_DESCRIPTION |
static String |
DEFAULT_OPTION_STRING |
static PropertyOption |
INSTANCE
A default PropertyOption instance
|
| Constructor and Description |
|---|
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
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
canProcess, checkPrefixes, defaults, equals, findOption, getId, getParent, hashCode, isRequired, setParent, toStringpublic static final String DEFAULT_OPTION_STRING
public static final String DEFAULT_DESCRIPTION
public static final PropertyOption INSTANCE
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 Optionpublic boolean canProcess(WriteableCommandLine commandLine, String argument)
OptioncommandLine - The CommandLine to checkargument - The argument to be testedpublic Set getPrefixes()
Optionpublic void process(WriteableCommandLine commandLine, ListIterator arguments) throws OptionException
OptioncommandLine - The CommandLine object to store results inarguments - The arguments to processOptionException - if any problems occurpublic Set getTriggers()
Optionpublic void validate(WriteableCommandLine commandLine)
OptioncommandLine - The CommandLine to check.public void appendUsage(StringBuffer buffer, Set helpSettings, Comparator comp)
Optionbuffer - the buffer to append tohelpSettings - a set of display settings @see DisplaySettingcomp - a comparator used to sort the Optionspublic String getPreferredName()
Optionpublic String getDescription()
OptionHelpFormatterpublic List helpLines(int depth, Set helpSettings, Comparator comp)
Optiondepth - the initial indent depthhelpSettings - the HelpSettings that should be appliedcomp - a comparator used to sort options when applicable.HelpLine,
HelpFormatterCopyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.