public class Command extends ParentImpl
| Constructor and Description |
|---|
Command(String preferredName,
String description,
Set aliases,
boolean required,
Argument argument,
Group children,
int id)
Creates a new Command instance.
|
| Modifier and Type | Method and Description |
|---|---|
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)
Processes the parent part of the Option.
|
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, getParent, hashCode, isRequired, setParent, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitcanProcess, getId, getParent, isRequired, setParentpublic 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 - 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)public void processParent(WriteableCommandLine commandLine, ListIterator arguments) throws OptionException
ParentcommandLine - the CommandLine to write results toarguments - a ListIterator over argument strings positioned at the next
argument to processOptionException - if an error occurs while processingOption.process(WriteableCommandLine, ListIterator)public Set getTriggers()
Optionpublic void validate(WriteableCommandLine commandLine) throws OptionException
Optionvalidate in interface Optionvalidate in class ParentImplcommandLine - The CommandLine to check.OptionException - if the CommandLine is not valid.public void appendUsage(StringBuffer buffer, Set helpSettings, Comparator comp)
OptionappendUsage 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 String getPreferredName()
OptionCopyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.