|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.cli2.option.OptionImpl
org.apache.commons.cli2.option.ParentImpl
org.apache.commons.cli2.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
Field Summary | |
---|---|
private java.util.Set |
aliases
The aliases for this command |
private java.lang.String |
preferredName
The display name for the command |
private java.util.Set |
triggers
All the names for this command |
Constructor Summary | |
---|---|
Command(java.lang.String preferredName,
java.lang.String description,
java.util.Set aliases,
boolean required,
Argument argument,
Group children,
int id)
Creates a new Command instance. |
Method Summary | |
---|---|
void |
appendUsage(java.lang.StringBuffer buffer,
java.util.Set helpSettings,
java.util.Comparator comp)
Appends usage information to the specified StringBuffer |
java.lang.String |
getPreferredName()
The preferred name of an option is used for generating help and usage information. |
java.util.Set |
getTriggers()
Identifies the argument prefixes that should trigger this option. |
void |
processParent(WriteableCommandLine commandLine,
java.util.ListIterator arguments)
Processes the parent part of the Option. |
void |
validate(WriteableCommandLine commandLine)
Checks that the supplied CommandLine is valid with respect to this option. |
Methods inherited from class org.apache.commons.cli2.option.ParentImpl |
---|
canProcess, defaults, findOption, getArgument, getChildren, getDescription, getPrefixes, helpLines, process |
Methods inherited from class org.apache.commons.cli2.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 org.apache.commons.cli2.Option |
---|
canProcess, getId, isRequired |
Field Detail |
---|
private final java.lang.String preferredName
private final java.util.Set aliases
private final java.util.Set triggers
Constructor Detail |
---|
public Command(java.lang.String preferredName, java.lang.String description, java.util.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
- Whether 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, java.util.ListIterator arguments) throws OptionException
Parent
commandLine
- the CommandLine to write results toarguments
- a ListIterator over argument strings positioned at the next
argument to process
OptionException
- if an error occurs while processingOption.process(WriteableCommandLine, ListIterator)
public java.util.Set getTriggers()
Option
public void validate(WriteableCommandLine commandLine) throws OptionException
Option
validate
in interface Option
validate
in class ParentImpl
commandLine
- The CommandLine to check.
OptionException
- if the CommandLine is not valid.public void appendUsage(java.lang.StringBuffer buffer, java.util.Set helpSettings, java.util.Comparator comp)
Option
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 java.lang.String getPreferredName()
Option
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |