@Retention(value=RUNTIME) @Target(value=TYPE) @Documented public @interface CliMode
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. options may be required but in another mode they should NOT be present. parsed the CliMode is
automatically detected and returned. This makes it even easier to implement your main-program and decide what to do.
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...)| Modifier and Type | Fields and Description |
|---|---|
static String |
ID_DEFAULT
|
static String |
ID_HELP
|
static String |
ID_VERSION
|
| Modifier and Type | Required Element and Description |
|---|---|
String |
id
The unique id of this
CliMode. |
| Modifier and Type | Optional Element and Description |
|---|---|
boolean |
isAbstract
true if this mode is abstract, false otherwise (default). |
String[] |
parentIds
|
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.
|
public static final String ID_DEFAULT
public static final String ID_HELP
public static final String ID_VERSION
public abstract String id
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[] 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.Copyright © 2001–2016 mmm-Team. All rights reserved.