@Documented @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.FIELD}) public @interface Option
Indicates that a method or property can be used to set a CLI option.
| Type | Name and Description |
|---|---|
Class |
convertA conversion closure to convert the incoming String into the desired object |
String |
defaultValueThe default value for this option as a String; subject to type conversion and 'convert'. |
String |
descriptionThe description of this option |
String |
longNameThe long name of this option. |
int |
numberOfArgumentsHow many arguments this option has. |
String |
numberOfArgumentsStringHow many arguments this option has represented as a String. |
boolean |
optionalArgWhether this option can have an optional argument. |
String |
shortNameThe short name of this option. |
String |
valueSeparatorThe value separator for this multivalued option. |
A conversion closure to convert the incoming String into the desired object
The default value for this option as a String; subject to type conversion and 'convert'. Ignored for Boolean options.
The description of this option
The long name of this option. Defaults to the name of member being annotated.
How many arguments this option has.
A value greater than 1 is only allowed for array-typed arguments.
Ignored for boolean options which are assumed to have a default of 0
or if numberOfArgumentsString is set.
How many arguments this option has represented as a String.
Only allowed for array-typed arguments.
Overrides numberOfArguments if set.
The special values of '+' means one or more and '*' as 0 or more.
Whether this option can have an optional argument. Only supported for array-typed arguments to indicate that the array may be empty.
The short name of this option. Defaults to the name of member being annotated if the longName is empty.
The value separator for this multivalued option. Only allowed for array-typed arguments.