|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||
@Retention(value=RUNTIME) @Target(value=TYPE) @Documented public @interface CliMode
A CliMode is used to annotate a CLI annotated class
in order to define a operational mode. Such mode is
referred by a CliOption or
CliArgument in order to group them. This allows to express which
options and arguments can be mixed and
which of them should NOT go together.
E.g. the options "--help" does NOT make sense to be mixed with "--shutdown".
Within some mode, options may be
required but in another mode they should NOT be
present.
When commandline parameters are parsed the CliMode is automatically detected and returned. This
makes it even easier to implement your main-program and decide what to do.
A CliMode can also be abstract. Such
mode can NOT be triggered so an option (or
argument) with an
abstract mode can only be used together with
another one that has a mode that is NOT
abstract and extends the
abstract mode.
CliModes,
CliOption.mode(),
CliParser.parseParameters(String...)| Required Element Summary | |
|---|---|
String |
id
The unique id of this CliMode. |
| Optional Element Summary | |
|---|---|
boolean |
isAbstract
true if this mode is abstract, false
otherwise (default). |
String[] |
parentIds
The IDs of the modes to extend. |
String |
title
The title of this CliMode for displaying in help-usage for the
end-user. |
String |
usage
A brief description of what the program actually does in this mode. |
| Element Detail |
|---|
public abstract String id
CliMode. Should match to
mode of options.
public abstract String title
CliMode for displaying in help-usage for the
end-user. The default is the empty string that is treated as fallback to
show the ID as title.
NlsMessagepublic abstract String usage
printed.
public abstract String[] parentIds
IDs of the modes to extend.options with different
modes and the first extends the second, then the
two options can be used together and the mode of the
extended mode is chosen. For the chosen mode and all modes inherited (recursively) all
required options have to be
present.
public abstract boolean isAbstract
true if this mode is abstract, false
otherwise (default).extend the abstract mode). If an option has a mode, that is abstract, then this option can only be used together
with another option that has a
mode that is NOT abstract and extends the abstract mode.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||