|
||||||||||
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.ParentImpl
public abstract class ParentImpl
A base implementation of Parent providing limited ground work for further Parent implementations.
Constructor Summary | |
---|---|
protected |
ParentImpl(Argument argument,
Group children,
String description,
int id,
boolean required)
Creation of a new ParaentImpl. |
Method Summary | |
---|---|
void |
appendUsage(StringBuffer buffer,
Set helpSettings,
Comparator comp)
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. |
Argument |
getArgument()
Return the argument value if any. |
Group |
getChildren()
Return any children. |
String |
getDescription()
Returns a description of the option. |
Set |
getPrefixes()
Identifies the argument prefixes that should be considered options. |
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. |
Methods inherited from class net.dpml.cli.option.OptionImpl |
---|
canProcess, checkPrefixes, equals, getId, hashCode, isRequired, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.dpml.cli.Parent |
---|
processParent |
Methods inherited from interface net.dpml.cli.Option |
---|
canProcess, getId, getPreferredName, getTriggers, isRequired |
Constructor Detail |
---|
protected ParentImpl(Argument argument, Group children, String description, int id, boolean required)
argument
- an argumentchildren
- the childrendescription
- the descriptionid
- the idrequired
- the required flagMethod Detail |
---|
public void process(WriteableCommandLine commandLine, ListIterator arguments) throws OptionException
process
in interface Option
commandLine
- the CommandLine object to store results inarguments
- the arguments to process
OptionException
- if any problems occurpublic boolean canProcess(WriteableCommandLine commandLine, String arg)
canProcess
in interface Option
commandLine
- the CommandLine object to store defaults inarg
- the argument to be tested
public Set getPrefixes()
getPrefixes
in interface Option
public void validate(WriteableCommandLine commandLine) throws OptionException
validate
in interface Option
commandLine
- the CommandLine to check.
OptionException
- if the CommandLine is not valid.public void appendUsage(StringBuffer buffer, Set helpSettings, Comparator comp)
appendUsage
in interface Option
buffer
- the buffer to append tohelpSettings
- a set of display settings @see DisplaySettingcomp
- a comparator used to sort the Optionspublic String getDescription()
getDescription
in interface Option
HelpFormatter
public List helpLines(int depth, Set helpSettings, Comparator comp)
helpLines
in interface Option
depth
- the initial indent depthhelpSettings
- the HelpSettings that should be appliedcomp
- a comparator used to sort options when applicable.
HelpLine
,
HelpFormatter
public Argument getArgument()
public Group getChildren()
public Option findOption(String trigger)
findOption
in interface Option
findOption
in class OptionImpl
trigger
- the trigger to search for.
public void defaults(WriteableCommandLine commandLine)
defaults
in interface Option
defaults
in class OptionImpl
commandLine
- the CommandLine object to store defaults in
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |