|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||
@Retention(value=RUNTIME) @Target(value=TYPE) @Documented public @interface CliStyle
A CliStyle is used to annotated a Java-class that holds the
parameters of a main-program that are parsed from the commandline arguments.
It declares the style of the CLI (command-line-interface) and therefore can
ensure conventions and common behavior of the CLI.
This annotation is optional. If it is not present, the defaults will apply.
The defaults are rather strict and tries to follow GNU-like conventions.
CliClass| Optional Element Summary | |
|---|---|
CliContainerStyle |
containerStyle
The style of container values. |
CliStyleHandling |
modeDuplicated
Determines how to handle a mode
that is declared more than once. |
CliStyleHandling |
modeUndefined
Determines how to handle an undefined
mode. |
CliStyleHandling |
optionDuplicated
Determines how to handle a boolean
CliOption that is supplied as CLI parameter multiple times (e.g. |
CliStyleHandling |
optionMissingBooleanValue
Determines how to handle a CliOption with
property-type Boolean that is not followed by a value (true/false)
as CLI parameter. |
CliStyleHandling |
optionMixedShortForm
Determines how to handle if boolean
options that have a short-form (see
CliParser.PREFIX_SHORT_OPTION) are mixed as a single CLI parameter
(e.g. |
Class<? extends Filter<String>> |
optionNameFilter
A Class with a public non-arg constructor that implements a
Filter of Strings in order to decide if the
name or alias of a
CliOption is acceptable. |
CliStyleHandling |
optionNameNotAcceptedByFilter
Determines how to handle a CliOption with
a name or alias that
is NOT accepted by
optionNameFilter(). |
CliStyleHandling |
optionSyntaxAssignment
Determines how to handle a CliOption that
is supplied as separate CLI parameter (e.g. |
CliStyleHandling |
optionSyntaxSeparated
Determines how to handle a CliOption that
is supplied as separate CLI parameter (e.g. |
CliStyleHandling |
valueDuplicateMapKey
Determines how to handle if the property-type
CliOption or CliArgument is a Map and two entries with the
same key are supplied on the commandline. |
public abstract CliStyleHandling optionSyntaxAssignment
handle a CliOption that
is supplied as separate CLI parameter (e.g.
--file=/foo/bar.txt). The default is
CliStyleHandling.EXCEPTION.
optionSyntaxSeparated()public abstract CliStyleHandling optionSyntaxSeparated
handle a CliOption that
is supplied as separate CLI parameter (e.g.
--file /foo/bar.txt). The default is CliStyleHandling.OK.
- See Also:
optionSyntaxAssignment()
- Default:
- net.sf.mmm.util.cli.api.CliStyleHandling.OK
public abstract CliStyleHandling optionMissingBooleanValue
handle a CliOption with
property-type Boolean that is not followed by a value (true/false)
as CLI parameter. The default is CliStyleHandling.EXCEPTION. If
allowed by this handling, the value defaults to
Boolean.TRUE.
public abstract CliStyleHandling optionDuplicated
handle a boolean
CliOption that is supplied as CLI parameter multiple times (e.g.
"--force --update --force" or "-fuf"). However this is generally forbidden
for values options. The default is
CliStyleHandling.EXCEPTION.
public abstract Class<? extends Filter<String>> optionNameFilter
Class with a public non-arg constructor that implements a
Filter of Strings in order to decide if the
name or alias of a
CliOption is acceptable.CliOptionNameDefaultFilter.
public abstract CliStyleHandling optionNameNotAcceptedByFilter
handle a CliOption with
a name or alias that
is NOT accepted by
optionNameFilter(). The default is
CliStyleHandling.EXCEPTION.
public abstract CliStyleHandling modeUndefined
handle an undefined
mode. The default is CliStyleHandling.EXCEPTION.
CliOption.mode(),
CliArgument.mode()public abstract CliStyleHandling modeDuplicated
handle a mode
that is declared more than once. If accepted, the deepest CliMode
annotation is selected from the Class hierarchy of the state-class. The default is CliStyleHandling.DEBUG.CliMode.
CliOption.mode(),
CliArgument.mode()public abstract CliContainerStyle containerStyle
style of container values. It shall NOT be
CliContainerStyle.DEFAULT. The default is
CliContainerStyle.MULTIPLE_OCCURRENCE. This setting can be
overridden via CliOption.containerStyle() or
CliArgument.containerStyle().
public abstract CliStyleHandling valueDuplicateMapKey
handle if the property-type
CliOption or CliArgument is a Map and two entries with the
same key are supplied on the commandline. The default is
CliStyleHandling.EXCEPTION.
public abstract CliStyleHandling optionMixedShortForm
handle if boolean
options that have a short-form (see
CliParser.PREFIX_SHORT_OPTION) are mixed as a single CLI parameter
(e.g. "-xfv" instead of "-x -f -v"). The default is
CliStyleHandling.OK.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||