|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Retention(value=RUNTIME) @Target(value={FIELD,PARAMETER}) public @interface Option
Defines an optional command parameter that can be interleaved with command arguments.
Options can be particularly useful as an alternative to adding additional arguments in cases where backwards compatibility of a command signature needs to be maintained, but can also be used for execution that are optional and have a reasonable default value for most cases.
Required Element Summary | |
---|---|
String |
longForm
The long form for the argument (e.g. |
char |
shortForm
The short (switch e.g. |
Optional Element Summary | |
---|---|
String |
defaultValue
The option's default value. |
String |
description
A brief description of the Option. |
String |
displayName
Returns a display name for the option. |
boolean |
required
Whether or not the option is required. |
String[] |
validOptions
Can be specified to limit the valid options. |
Element Detail |
---|
public abstract char shortForm
public abstract String longForm
public abstract String displayName
This value can be used by user interfaces in place of
the actual option name. When this value is omitted,
the longForm()
can be used.
public abstract String description
public abstract String defaultValue
public abstract boolean required
public abstract String[] validOptions
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |