public class GroupImpl extends OptionImpl implements Group
| Constructor and Description |
|---|
GroupImpl(java.util.List options,
java.lang.String name,
java.lang.String description,
int minimum,
int maximum)
Creates a new GroupImpl using the specified parameters.
|
| Modifier and Type | Method and Description |
|---|---|
void |
appendUsage(java.lang.StringBuffer buffer,
java.util.Set helpSettings,
java.util.Comparator comp)
Appends usage information to the specified StringBuffer
|
void |
appendUsage(java.lang.StringBuffer buffer,
java.util.Set helpSettings,
java.util.Comparator comp,
java.lang.String separator)
Appends usage information to the specified StringBuffer
|
boolean |
canProcess(WriteableCommandLine commandLine,
java.lang.String arg)
Indicates whether this Option will be able to process the particular
argument.
|
void |
defaults(WriteableCommandLine commandLine)
Process defaults.
|
Option |
findOption(java.lang.String trigger)
Recursively searches for an option with the supplied trigger.
|
java.util.List |
getAnonymous()
Gets the m_anonymous Arguments of this Group.
|
java.lang.String |
getDescription()
Returns a description of the option.
|
int |
getMaximum()
Retrieves the maximum number of values acceptable for a valid Argument
|
int |
getMinimum()
Retrieves the minimum number of values required for a valid Argument
|
java.util.List |
getOptions()
Gets the member Options of thie Group.
|
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.
|
boolean |
isRequired()
Indicates whether argument values must be present for the CommandLine to
be valid.
|
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.
|
canProcess, checkPrefixes, equals, getId, hashCode, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitcanProcess, getIdpublic GroupImpl(java.util.List options, java.lang.String name, java.lang.String description, int minimum, int maximum)
options - the Options and Arguments that make up the Groupname - the name of this Group, or nulldescription - a description of this Groupminimum - the minimum number of Options for a valid CommandLinemaximum - the maximum number of Options for a valid CommandLinepublic boolean canProcess(WriteableCommandLine commandLine, java.lang.String arg)
canProcess in interface OptioncommandLine - the CommandLine object to store defaults inarg - the argument to be testedpublic java.util.Set getPrefixes()
getPrefixes in interface Optionpublic java.util.Set getTriggers()
getTriggers in interface Optionpublic void process(WriteableCommandLine commandLine, java.util.ListIterator arguments) throws OptionException
process in interface OptioncommandLine - the CommandLine object to store results inarguments - the arguments to processOptionException - if any problems occurpublic void validate(WriteableCommandLine commandLine) throws OptionException
validate in interface OptioncommandLine - the CommandLine to check.OptionException - if the CommandLine is not valid.public java.lang.String getPreferredName()
getPreferredName in interface Optionpublic java.lang.String getDescription()
getDescription in interface OptionHelpFormatterpublic void appendUsage(java.lang.StringBuffer buffer, java.util.Set helpSettings, java.util.Comparator comp)
appendUsage in interface Optionbuffer - the buffer to append tohelpSettings - a set of display settings @see DisplaySettingcomp - a comparator used to sort the Optionspublic void appendUsage(java.lang.StringBuffer buffer, java.util.Set helpSettings, java.util.Comparator comp, java.lang.String separator)
appendUsage in interface Groupbuffer - the buffer to append tohelpSettings - a set of display settings @see DisplaySettingcomp - a comparator used to sort the Optionsseparator - the String used to separate member Optionspublic java.util.List helpLines(int depth, java.util.Set helpSettings, java.util.Comparator comp)
helpLines in interface Optiondepth - the initial indent depthhelpSettings - the HelpSettings that should be appliedcomp - a comparator used to sort options when applicable.HelpLine,
HelpFormatterpublic java.util.List getOptions()
public java.util.List getAnonymous()
public Option findOption(java.lang.String trigger)
findOption in interface OptionfindOption in class OptionImpltrigger - the trigger to search for.public int getMinimum()
getMinimum in interface Grouppublic int getMaximum()
getMaximum in interface Grouppublic boolean isRequired()
isRequired in interface GroupisRequired in interface OptionisRequired in class OptionImplgetMinimum(),
getMaximum()public void defaults(WriteableCommandLine commandLine)
defaults in interface Optiondefaults in class OptionImplcommandLine - the commandline