|
||||||||||
| 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.GroupImpl
public class GroupImpl
An implementation of Group
| Constructor Summary | |
|---|---|
GroupImpl(List options,
String name,
String description,
int minimum,
int maximum)
Creates a new GroupImpl using the specified parameters. |
|
| Method Summary | |
|---|---|
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)
Process defaults. |
Option |
findOption(String trigger)
Recursively searches for an option with the supplied trigger. |
List |
getAnonymous()
Gets the m_anonymous Arguments of this Group. |
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 |
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()
Indicates whether argument values must be present for the CommandLine to be valid. |
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. |
| Methods inherited from class net.dpml.cli.option.OptionImpl |
|---|
canProcess, checkPrefixes, equals, getId, hashCode, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface net.dpml.cli.Option |
|---|
canProcess, getId |
| Constructor Detail |
|---|
public GroupImpl(List options,
String name,
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 CommandLine| Method Detail |
|---|
public boolean canProcess(WriteableCommandLine commandLine,
String arg)
canProcess in interface OptioncommandLine - the CommandLine object to store defaults inarg - the argument to be tested
public Set getPrefixes()
getPrefixes in interface Optionpublic Set getTriggers()
getTriggers in interface Option
public void process(WriteableCommandLine commandLine,
ListIterator arguments)
throws OptionException
process in interface OptioncommandLine - the CommandLine object to store results inarguments - the arguments to process
OptionException - if any problems occur
public void validate(WriteableCommandLine commandLine)
throws OptionException
validate in interface OptioncommandLine - the CommandLine to check.
OptionException - if the CommandLine is not valid.public String getPreferredName()
getPreferredName in interface Optionpublic String getDescription()
getDescription in interface OptionHelpFormatter
public void appendUsage(StringBuffer buffer,
Set helpSettings,
Comparator comp)
appendUsage in interface Optionbuffer - the buffer to append tohelpSettings - a set of display settings @see DisplaySettingcomp - a comparator used to sort the Options
public void appendUsage(StringBuffer buffer,
Set helpSettings,
Comparator comp,
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 Options
public List helpLines(int depth,
Set helpSettings,
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 List getOptions()
public List getAnonymous()
public Option findOption(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
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||