public class Command extends ParentImpl
| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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)
Process the parent.
|
void |
validate(WriteableCommandLine commandLine)
Checks that the supplied CommandLine is valid with respect to this
option.
|
canProcess, defaults, findOption, getArgument, getChildren, getDescription, getPrefixes, helpLines, processcanProcess, checkPrefixes, equals, getId, hashCode, isRequired, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitcanProcess, getId, isRequiredpublic 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 - 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)public void processParent(WriteableCommandLine commandLine, java.util.ListIterator arguments) throws OptionException
commandLine - the commandlinearguments - an iterator of argumentsOptionException - if an error occursOption.process(WriteableCommandLine, ListIterator)public java.util.Set getTriggers()
public void validate(WriteableCommandLine commandLine) throws OptionException
validate in interface Optionvalidate in class ParentImplcommandLine - 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)
appendUsage in interface OptionappendUsage in class ParentImplbuffer - the buffer to append tohelpSettings - a set of display settings @see DisplaySettingcomp - a comparator used to sort the Optionspublic java.lang.String getPreferredName()