Annotation Interface ShellOption
Used to customize handling of a
ShellMethod
parameter.-
Nested Class Summary
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionint
Return the number of input "words" this parameter consumes.The textual (pre-conversion) value to assign to this parameter if no value is provided by the user.Return a short description of the parameter.boolean
Used to indicate to the framework that the given parameter should NOT be resolved byStandardParameterResolver
.String[]
The key(s) by which this parameter can be referenced when using named parameters.Class<? extends ValueProvider>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Marker value to indicate that heuristics should be used to derive arity.static final String
Used to indicate that there is no default value (i.e. parameter is mandatory).static final String
Used to indicate that the default value is the value null, which is different from the fact that there is no default value.
-
Field Details
-
NULL
Used to indicate that the default value is the value null, which is different from the fact that there is no default value.- See Also:
-
NONE
Used to indicate that there is no default value (i.e. parameter is mandatory).- See Also:
-
ARITY_USE_HEURISTICS
static final int ARITY_USE_HEURISTICSMarker value to indicate that heuristics should be used to derive arity.- See Also:
-
-
Element Details
-
value
String[] valueThe key(s) by which this parameter can be referenced when using named parameters. If none is specified, the actual method parameter name will be used, prefixed by the methodShellMethod.prefix()
.- Returns:
- explicit key(s) to use to pass a value for this parameter
- Default:
- {}
-
arity
int arityReturn the number of input "words" this parameter consumes. Default is 1, except when parameter type is boolean, in which case it is 0.- Returns:
- the number of words to map to this parameter
- Default:
- -1
-
defaultValue
String defaultValueThe textual (pre-conversion) value to assign to this parameter if no value is provided by the user.- Returns:
- the default value for this parameter
- Default:
- "__NONE__"
-
help
String helpReturn a short description of the parameter.- Returns:
- description of the parameter
- Default:
- ""
-
valueProvider
Class<? extends ValueProvider> valueProvider- Default:
- org.springframework.shell.standard.ShellOption.NoValueProvider.class
-
optOut
boolean optOutUsed to indicate to the framework that the given parameter should NOT be resolved byStandardParameterResolver
. This is useful if several implementations oforg.springframework.shell.ParameterResolver
are present, given that the standard one can work with no annotation at all. Note that this is not used anymore!- Returns:
- true to indicate that the
StandardParameterResolver
should not be used for this parameter
- Default:
- false
-