|
||||||||||
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
net.dpml.cli.option.Command
public class Command
Represents a cvs "update" style command line option. Like all Parents, Commands can have child options and can be part of Arguments.
Constructor Summary | |
---|---|
Command(String preferredName,
String description,
Set aliases,
boolean required,
Argument argument,
Group children,
int id)
Creates a new Command instance. |
Method Summary | |
---|---|
void |
appendUsage(StringBuffer buffer,
Set helpSettings,
Comparator comp)
Appends usage information to the specified StringBuffer |
String |
getPreferredName()
The preferred name of an option is used for generating help and usage information. |
Set |
getTriggers()
Identifies the argument prefixes that should trigger this option. |
void |
processParent(WriteableCommandLine commandLine,
ListIterator arguments)
Process the parent. |
void |
validate(WriteableCommandLine commandLine)
Checks that the supplied CommandLine is valid with respect to this option. |
Methods inherited from class net.dpml.cli.option.ParentImpl |
---|
canProcess, defaults, findOption, getArgument, getChildren, getDescription, getPrefixes, helpLines, process |
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.Option |
---|
canProcess, getId, isRequired |
Constructor Detail |
---|
public Command(String preferredName, String description, Set aliases, boolean required, Argument argument, Group children, int id)
preferredName
- the name normally used to refer to the Commanddescription
- a description of the Commandaliases
- alternative names for the Commandrequired
- true if the Command is requiredargument
- an Argument that the command takeschildren
- the Group of child options for this Commandid
- a unique id for the CommandParentImpl.ParentImpl(Argument, Group, String, int, boolean)
Method Detail |
---|
public void processParent(WriteableCommandLine commandLine, ListIterator arguments) throws OptionException
commandLine
- the commandlinearguments
- an iterator of arguments
OptionException
- if an error occursOption.process(WriteableCommandLine, ListIterator)
public Set getTriggers()
public void validate(WriteableCommandLine commandLine) throws OptionException
validate
in interface Option
validate
in class ParentImpl
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
appendUsage
in class ParentImpl
buffer
- the buffer to append tohelpSettings
- a set of display settings @see DisplaySettingcomp
- a comparator used to sort the Optionspublic String getPreferredName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |