V - represents the type of the arguments this option acceptspublic abstract class AbstractOptionSpec<V> extends java.lang.Object implements OptionSpec<V>, OptionDescriptor
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
description |
private boolean |
forHelp |
private java.util.List<java.lang.String> |
options |
| Constructor and Description |
|---|
AbstractOptionSpec(java.util.List<java.lang.String> options,
java.lang.String description) |
AbstractOptionSpec(java.lang.String option) |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
argumentTypeIndicatorFrom(ValueConverter<V> converter) |
private void |
arrangeOptions(java.util.List<java.lang.String> unarranged) |
protected abstract V |
convert(java.lang.String argument) |
protected V |
convertWith(ValueConverter<V> converter,
java.lang.String argument) |
java.lang.String |
description()
Description of this option's purpose.
|
boolean |
equals(java.lang.Object that) |
AbstractOptionSpec<V> |
forHelp() |
(package private) abstract void |
handleOption(OptionParser parser,
ArgumentList arguments,
OptionSet detectedOptions,
java.lang.String detectedArgument) |
int |
hashCode() |
boolean |
isForHelp()
Tells whether this option is designated as a "help" option.
|
java.util.List<java.lang.String> |
options()
A set of options that are mutually synonymous.
|
boolean |
representsNonOptions()
Tells whether this object represents the non-option arguments of a command line.
|
java.lang.String |
toString() |
V |
value(OptionSet detectedOptions)
Gives the argument associated with the given option in the given set of detected options.
|
java.util.List<V> |
values(OptionSet detectedOptions)
Gives any arguments associated with the given option in the given set of detected options.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitacceptsArguments, argumentDescription, argumentTypeIndicator, defaultValues, isRequired, requiresArgumentprivate final java.util.List<java.lang.String> options
private final java.lang.String description
private boolean forHelp
AbstractOptionSpec(java.lang.String option)
AbstractOptionSpec(java.util.List<java.lang.String> options,
java.lang.String description)
public final java.util.List<java.lang.String> options()
OptionDescriptoroptions in interface OptionDescriptoroptions in interface OptionSpec<V>public final java.util.List<V> values(OptionSet detectedOptions)
OptionSpecSpecifying a default argument value for this option will cause this method to return that default value even if this option was not detected on the command line, or if this option can take an optional argument but did not have one on the command line.
values in interface OptionSpec<V>detectedOptions - the detected options to search inOptionSet.valuesOf(OptionSpec)public final V value(OptionSet detectedOptions)
OptionSpecSpecifying a default argument value for this option will cause this method to return that default value even if this option was not detected on the command line, or if this option can take an optional argument but did not have one on the command line.
value in interface OptionSpec<V>detectedOptions - the detected options to search innull if no argument is present, or that option was not detectedOptionSet.valueOf(OptionSpec)public java.lang.String description()
OptionDescriptordescription in interface OptionDescriptorpublic final AbstractOptionSpec<V> forHelp()
public final boolean isForHelp()
OptionSpecisForHelp in interface OptionSpec<V>public boolean representsNonOptions()
OptionDescriptorrepresentsNonOptions in interface OptionDescriptortrue if this represents non-option argumentsprotected abstract V convert(java.lang.String argument)
protected V convertWith(ValueConverter<V> converter, java.lang.String argument)
protected java.lang.String argumentTypeIndicatorFrom(ValueConverter<V> converter)
abstract void handleOption(OptionParser parser, ArgumentList arguments, OptionSet detectedOptions, java.lang.String detectedArgument)
private void arrangeOptions(java.util.List<java.lang.String> unarranged)
public boolean equals(java.lang.Object that)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object