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, toString
public 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)
Option
commandLine
- The CommandLine to checkargument
- The argument to be testedpublic Set getPrefixes()
Option
public void process(WriteableCommandLine commandLine, ListIterator arguments) throws OptionException
Option
commandLine
- The CommandLine object to store results inarguments
- The arguments to processOptionException
- 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
Copyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.