Example usage for Java org.apache.commons.cli Option fields, constructors, methods, implement or subclass
The text is from its open source code.
int | UNINITIALIZED constant that specifies the number of argument values has not been specified |
int | UNLIMITED_VALUES constant that specifies the number of argument values is infinite |
String | opt the name of the option |
String | longOpt the long representation of the option |
String | argName the name of the argument for this option |
String | description description of the option |
boolean | required specifies whether this option is required to be present |
int | numberOfArgs the number of argument values this option can have |
Object | type the type of this Option |
Option(String opt, String longOpt, boolean hasArg, String description) Creates an Option using the specified parameters. | |
Option(String opt, boolean hasArg, String description) Creates an Option using the specified parameters. | |
Option(String opt, String description) Creates an Option using the specified parameters. |
void | add(String value) Add the value to this Option. |
boolean | addValue(String value) This method is not intended to be used. |
Object | clone() A rather odd clone method - due to incorrect code in 1.0 it is public and in 1.1 rather than throwing a CloneNotSupportedException it throws a RuntimeException so as to maintain backwards compat at the API level. |
boolean | equals(Object o) |
String | getArgName() Gets the display name for the argument value. |
int | getArgs() Returns the number of argument values this Option can take. |
String | getDescription() Retrieve the self-documenting description of this Option |
int | getId() Returns the id of this Option. |
String | getLongOpt() Retrieve the long name of this Option. |
String | getOpt() Retrieve the name of this Option. |
Object | getType() Retrieve the type of this Option. |
String | getValue() Returns the specified value of this Option or null if there is no value. |
String | getValue(int index) Returns the specified value of this Option or null if there is no value. |
String | getValue(String defaultValue) Returns the value/first value of this Option or the defaultValue if there is no value. |
String[] | getValues() Return the values of this Option as a String array or null if there are no values |
char | getValueSeparator() Returns the value separator character. |
List | getValuesList() |
boolean | hasArg() Query to see if this Option requires an argument |
boolean | hasArgName() Returns whether the display name for the argument value has been set. |
boolean | hasArgs() Query to see if this Option can take many values. |
boolean | hasLongOpt() Query to see if this Option has a long name |
boolean | hasOptionalArg() |
boolean | hasValueSeparator() Return whether this Option has specified a value separator. |
boolean | isRequired() Query to see if this Option requires an argument |
void | setArgName(String argName) Sets the display name for the argument value. |
void | setArgs(int num) Sets the number of argument values this Option can take. |
void | setDescription(String description) Sets the self-documenting description of this Option |
void | setLongOpt(String longOpt) Sets the long name of this Option. |
void | setOptionalArg(boolean optionalArg) Sets whether this Option can have an optional argument. |
void | setRequired(boolean required) Sets whether this Option is mandatory. |
void | setType(Object type) Sets the type of this Option. |
void | setValueSeparator(char sep) Sets the value separator. |
String | toString() Dump state, suitable for debugging. |