net.sf.mmm.util.cli.api
Annotation Type CliStyle


@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.

Since:
2.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)
See Also:
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.
 

optionSyntaxAssignment

public abstract CliStyleHandling optionSyntaxAssignment
Determines how to handle a CliOption that is supplied as separate CLI parameter (e.g. --file=/foo/bar.txt). The default is CliStyleHandling.EXCEPTION.

See Also:
optionSyntaxSeparated()
Default:
net.sf.mmm.util.cli.api.CliStyleHandling.EXCEPTION

optionSyntaxSeparated

public abstract CliStyleHandling optionSyntaxSeparated
Determines how to 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

optionMissingBooleanValue

public abstract CliStyleHandling optionMissingBooleanValue
Determines how to 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.

Default:
net.sf.mmm.util.cli.api.CliStyleHandling.EXCEPTION

optionDuplicated

public abstract CliStyleHandling optionDuplicated
Determines how to 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.

Default:
net.sf.mmm.util.cli.api.CliStyleHandling.EXCEPTION

optionNameFilter

public abstract 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.
The default is CliOptionNameDefaultFilter.

Default:
net.sf.mmm.util.cli.api.CliOptionNameDefaultFilter.class

optionNameNotAcceptedByFilter

public abstract CliStyleHandling optionNameNotAcceptedByFilter
Determines how to handle a CliOption with a name or alias that is NOT accepted by optionNameFilter(). The default is CliStyleHandling.EXCEPTION.

Default:
net.sf.mmm.util.cli.api.CliStyleHandling.EXCEPTION

modeUndefined

public abstract CliStyleHandling modeUndefined
Determines how to handle an undefined mode. The default is CliStyleHandling.EXCEPTION.

See Also:
CliOption.mode(), CliArgument.mode()
Default:
net.sf.mmm.util.cli.api.CliStyleHandling.EXCEPTION

modeDuplicated

public abstract CliStyleHandling modeDuplicated
Determines how to 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.
ATTENTION:
Please note that it can make sense to override a CliMode.

See Also:
CliOption.mode(), CliArgument.mode()
Default:
net.sf.mmm.util.cli.api.CliStyleHandling.DEBUG

containerStyle

public abstract CliContainerStyle containerStyle
The 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().

Default:
net.sf.mmm.util.cli.api.CliContainerStyle.MULTIPLE_OCCURRENCE

valueDuplicateMapKey

public abstract 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. The default is CliStyleHandling.EXCEPTION.

Default:
net.sf.mmm.util.cli.api.CliStyleHandling.EXCEPTION

optionMixedShortForm

public abstract 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. "-xfv" instead of "-x -f -v"). The default is CliStyleHandling.OK.

Default:
net.sf.mmm.util.cli.api.CliStyleHandling.OK


Copyright © 2001-2010 mmm-Team. All Rights Reserved.