Specification of an option that accepts an argument.
Instances are returned from OptionSpecBuilder methods to allow the formation of parser directives as
sentences in a "fluent interface" language. For example:
OptionParser parser = new OptionParser();
parser.accepts( "c" ).withRequiredArg().ofType( Integer.class );
If no methods are invoked on an instance of this class, then that instance's option will treat its argument as
a String.
| Modifier and Type | Field and Description |
|---|---|
| private String | |
| private final boolean | |
| private ValueConverter | |
| private final List | |
| private static final char | |
| private boolean | |
| private String |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | acceptsArguments()
Implements jdk. Does this option accept arguments? |
| protected void | |
| private void | |
| public String | argumentDescription()
Implements jdk. Gives a short description of the option's argument. |
| public String | argumentTypeIndicator()
Implements jdk. Gives an indication of the expected type of the option's argument. |
| protected boolean | |
| protected final V | |
| public final ArgumentAcceptingOptionSpec | Returns: self, so that the caller can add clauses to the fluent interface sentencethe first in the set of default argument values for this spec's option value, V... the (optional) remainder of the set of default argument values for this spec's option values)Specifies a set of default values for the argument of the option that this spec represents. |
| public ArgumentAcceptingOptionSpec | Returns: self, so that the caller can add clauses to the fluent interface sentencethe set of default argument values for this spec's option values)Specifies a set of default values for the argument of the option that this spec represents. |
| public List | defaultValues()
Implements jdk. What values will the option take if none are specified on the command line? |
| public final ArgumentAcceptingOptionSpec | Returns: self, so that the caller can add clauses to the fluent interface sentencedescribes the nature of the argument of this spec's option description)Specifies a description for the argument of the option that this spec represents. |
| protected abstract void | |
| public boolean | equals(Object that)
Overrides jdk. Indicates whether some other object is "equal to" this one. |
| pack-priv final void | handleOption(OptionParser parser, ArgumentList arguments, OptionSet detectedOptions, String detectedArgument)
Implements abstract jdk.
|
| public int | hashCode()
Overrides jdk. Returns a hash code value for this object. |
| protected boolean | |
| public boolean | isRequired()
Implements jdk. Is this option required on a command line? |
| public final < represents the runtime class of the desired option argument type T> ArgumentAcceptingOptionSpec | |
| public ArgumentAcceptingOptionSpec | Returns: self, so that the caller can add clauses to the fluent interface sentenceMarks this option as required. |
| public boolean | requiresArgument()
Implements jdk. Does this option require an argument? |
| public final < represents the runtime class of the desired option argument type T> ArgumentAcceptingOptionSpec | Returns: self, so that the caller can add clauses to the fluent interface sentencethe converter to use aConverter)Specifies a converter to use to translate arguments of this spec's option into Java objects. |
| public final ArgumentAcceptingOptionSpec | Returns: self, so that the caller can add clauses to the fluent interface sentencea character separator separator)Specifies a value separator for the argument of the option that this spec represents. |
| public final ArgumentAcceptingOptionSpec | Returns: self, so that the caller can add clauses to the fluent interface sentencea string separator separator)Specifies a value separator for the argument of the option that this spec represents. |
| argumentDescription | back to summary |
|---|---|
| private String argumentDescription | |
| argumentRequired | back to summary |
|---|---|
| private final boolean argumentRequired | |
| converter | back to summary |
|---|---|
| private ValueConverter<V> converter | |
| defaultValues | back to summary |
|---|---|
| private final List<V> defaultValues | |
| NIL_VALUE_SEPARATOR | back to summary |
|---|---|
| private static final char NIL_VALUE_SEPARATOR | |
| optionRequired | back to summary |
|---|---|
| private boolean optionRequired | |
| valueSeparator | back to summary |
|---|---|
| private String valueSeparator | |
| ArgumentAcceptingOptionSpec | back to summary |
|---|---|
| pack-priv ArgumentAcceptingOptionSpec(String option, boolean argumentRequired) | |
| ArgumentAcceptingOptionSpec | back to summary |
|---|---|
| pack-priv ArgumentAcceptingOptionSpec(List<String> options, boolean argumentRequired, String description) | |
| acceptsArguments | back to summary |
|---|---|
| public boolean acceptsArguments() Implements jdk. Doc from jdk. Does this option accept arguments? | |
| addArguments | back to summary |
|---|---|
| protected void addArguments(OptionSet detectedOptions, String detectedArgument) | |
| addDefaultValue | back to summary |
|---|---|
| private void addDefaultValue(V value) | |
| argumentDescription | back to summary |
|---|---|
| public String argumentDescription() Implements jdk. Doc from jdk. Gives a short description of the option's argument. | |
| argumentTypeIndicator | back to summary |
|---|---|
| public String argumentTypeIndicator() Implements jdk. Doc from jdk. Gives an indication of the expected type of the option's argument. | |
| canConvertArgument | back to summary |
|---|---|
| protected boolean canConvertArgument(String argument) | |
| convert | back to summary |
|---|---|
| protected final V convert(String argument) Implements abstract jdk.
| |
| defaultsTo | back to summary |
|---|---|
| public final ArgumentAcceptingOptionSpec Specifies a set of default values for the argument of the option that this spec represents.
| |
| defaultsTo | back to summary |
|---|---|
| public ArgumentAcceptingOptionSpec Specifies a set of default values for the argument of the option that this spec represents.
| |
| defaultValues | back to summary |
|---|---|
| public List Implements jdk. Doc from jdk. What values will the option take if none are specified on the command line? | |
| describedAs | back to summary |
|---|---|
| public final ArgumentAcceptingOptionSpec Specifies a description for the argument of the option that this spec represents. This description is used when generating help information about the parser.
| |
| detectOptionArgument | back to summary |
|---|---|
| protected abstract void detectOptionArgument(OptionParser parser, ArgumentList arguments, OptionSet detectedOptions) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object that) Overrides jdk. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| handleOption | back to summary |
|---|---|
| pack-priv final void handleOption(OptionParser parser, ArgumentList arguments, OptionSet detectedOptions, String detectedArgument) Implements abstract jdk.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides jdk. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isArgumentOfNumberType | back to summary |
|---|---|
| protected boolean isArgumentOfNumberType() | |
| isRequired | back to summary |
|---|---|
| public boolean isRequired() Implements jdk. Doc from jdk. Is this option required on a command line? | |
| ofType | back to summary |
|---|---|
| public final <T> ArgumentAcceptingOptionSpec Specifies a type to which arguments of this spec's option are to be converted. JOpt Simple accepts types that have either:
This class converts arguments using those methods in that order; that is, Invoking this method will trump any previous calls to this method or to
| |
| required | back to summary |
|---|---|
| public ArgumentAcceptingOptionSpec Marks this option as required. An
| |
| requiresArgument | back to summary |
|---|---|
| public boolean requiresArgument() Implements jdk. Doc from jdk. Does this option require an argument? | |
| withValuesConvertedBy | back to summary |
|---|---|
| public final <T> ArgumentAcceptingOptionSpec Specifies a converter to use to translate arguments of this spec's option into Java objects. This is useful
when converting to types that do not have the requisite factory method or constructor for
Invoking this method will trump any previous calls to this method or to
| |
| withValuesSeparatedBy | back to summary |
|---|---|
| public final ArgumentAcceptingOptionSpec Specifies a value separator for the argument of the option that this spec represents. This allows a single option argument to represent multiple values for the option. For example:
Then You cannot use Unicode U+0000 as the separator.
| |
| withValuesSeparatedBy | back to summary |
|---|---|
| public final ArgumentAcceptingOptionSpec Specifies a value separator for the argument of the option that this spec represents. This allows a single option argument to represent multiple values for the option. For example:
Then You cannot use Unicode U+0000 in the separator.
| |