@Retention(value=RUNTIME) @Target(value=TYPE) @Documented public @interface CliStyle
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. CliClass| Modifier and Type | Optional Element and Description |
|---|---|
CliContainerStyle |
containerStyle
The
style of container values. |
CliStyleHandling |
modeDuplicated
|
CliStyleHandling |
modeUndefined
|
CliStyleHandling |
optionDuplicated
|
CliStyleHandling |
optionMissingBooleanValue
|
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
|
CliStyleHandling |
optionNameNotAcceptedByFilter
|
CliStyleHandling |
optionSyntaxAssignment
|
CliStyleHandling |
optionSyntaxSeparated
|
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.optionSyntaxAssignment()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
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.Copyright © 2001–2016 mmm-Team. All rights reserved.