public class GroupImpl extends OptionImpl implements Group
| Constructor and Description |
|---|
GroupImpl(List options,
String name,
String description,
int minimum,
int maximum,
boolean required)
Creates a new GroupImpl 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
|
void |
appendUsage(StringBuffer buffer,
Set helpSettings,
Comparator comp,
String separator)
Appends usage information to the specified StringBuffer
|
boolean |
canProcess(WriteableCommandLine commandLine,
String arg)
Indicates whether this Option will be able to process the particular
argument.
|
void |
defaults(WriteableCommandLine commandLine)
Adds defaults to a CommandLine.
|
Option |
findOption(String trigger)
Recursively searches for an option with the supplied trigger.
|
List |
getAnonymous()
Gets the anonymous Arguments of this Group.
|
String |
getDescription()
Returns a description of the option.
|
int |
getMaximum()
Retrieves the maximum number of members acceptable for a valid Group
|
int |
getMinimum()
Retrieves the minimum number of members required for a valid Group
|
List |
getOptions()
Gets the member Options of thie Group.
|
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.
|
boolean |
isRequired()
Tests whether this option is required.
|
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, equals, getId, getParent, hashCode, setParent, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitcanProcess, getId, getParent, setParentpublic GroupImpl(List options, String name, String description, int minimum, int maximum, boolean required)
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 CommandLinerequired - a flag whether this group is requiredpublic boolean canProcess(WriteableCommandLine commandLine, String arg)
OptioncanProcess in interface OptioncommandLine - The CommandLine to checkarg - The argument to be testedpublic Set getPrefixes()
OptiongetPrefixes in interface Optionpublic Set getTriggers()
OptiongetTriggers in interface Optionpublic void process(WriteableCommandLine commandLine, ListIterator arguments) throws OptionException
Optionprocess in interface OptioncommandLine - The CommandLine object to store results inarguments - The arguments to processOptionException - if any problems occurpublic void validate(WriteableCommandLine commandLine) throws OptionException
Optionvalidate in interface OptioncommandLine - The CommandLine to check.OptionException - if the CommandLine is not valid.public String getPreferredName()
OptiongetPreferredName in interface Optionpublic String getDescription()
OptiongetDescription in interface OptionHelpFormatterpublic void appendUsage(StringBuffer buffer, Set helpSettings, Comparator comp)
OptionappendUsage in interface Optionbuffer - the buffer to append tohelpSettings - a set of display settings @see DisplaySettingcomp - a comparator used to sort the Optionspublic void appendUsage(StringBuffer buffer, Set helpSettings, Comparator comp, String separator)
GroupappendUsage 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 List helpLines(int depth, Set helpSettings, Comparator comp)
OptionhelpLines in interface Optiondepth - the initial indent depthhelpSettings - the HelpSettings that should be appliedcomp - a comparator used to sort options when applicable.HelpLine,
HelpFormatterpublic List getOptions()
public List getAnonymous()
public Option findOption(String trigger)
OptionfindOption in interface OptionfindOption in class OptionImpltrigger - the trigger to search for.public int getMinimum()
GroupgetMinimum in interface Grouppublic int getMaximum()
GroupgetMaximum in interface Grouppublic boolean isRequired()
required flag common to all options, but also take the
minimum constraints into account.isRequired in interface GroupisRequired in interface OptionisRequired in class OptionImplGroup.getMinimum(),
Group.getMaximum()public void defaults(WriteableCommandLine commandLine)
Optiondefaults in interface Optiondefaults in class OptionImplcommandLine - The CommandLine object to store defaults inCopyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.