@Inherited @Documented @Retention(value=RUNTIME) @Target(value=PARAMETER) public @interface CliOption
Modifier and Type | Required Element and Description |
---|---|
String[] |
key |
Modifier and Type | Optional Element and Description |
---|---|
String |
help |
boolean |
hidden |
boolean |
mandatory |
String |
optionContext
Returns a string providing context-specific information (e.g. a comma-delimited
set of keywords) to the
Converter that handles the annotated parameter's type. |
String |
specifiedDefaultValue |
boolean |
systemProvided |
String |
unspecifiedDefaultValue |
public abstract String[] key
CliCommand
(an empty String may
be given, which would denote this option is the default for the command)public abstract boolean systemProvided
public abstract boolean mandatory
public abstract boolean hidden
public abstract String unspecifiedDefaultValue
public abstract String specifiedDefaultValue
public abstract String optionContext
Converter
that handles the annotated parameter's type.
For example, if a method parameter "thing" of type "Thing" is annotated as follows:
@CliOption(..., optionContext = "foo,bar", ...) Thing thing... then the
Converter
that converts the text entered by the user
into an instance of Thing will be passed "foo,bar" as the value of the
optionContext
parameter in its public methods. This allows
the behaviour of that Converter to be individually customised for each
CliOption
of each CliCommand
.null
string (can be empty)public abstract String help