Top Description Fields Methods
io.vertx.core.cli.annotations

public @Interface Option

extends Annotation
Annotations
@Target:METHOD
@Retention:RUNTIME
Imports
java.lang.annotation.ElementType, .Retention, .RetentionPolicy, .Target

Annotates a setter to be called with the value of a command line option. Setter have been preferred to field to allow validation.

The cardinality of the option is detected from the single method parameter type: arrays, list and set can receive several values.

Author
Clement Escoffier
See Also
Argument

Field Summary

Modifier and TypeField and Description
public static final String

Method Summary

Modifier and TypeMethod and Description
public boolean
acceptMultipleValues()

Whether or not the option accept multiple values.

public boolean
acceptValue()

Whether or not the option accept a value.

public String
argName()

The name of this argument (used in doc)

public String[]
choices()

The set of choices accepted as values by this option.

public boolean
flag()

Whether or not the option can be used as a flag (meaning no value)

public boolean
help()

Whether or not this option is a "Help" option.

public String
longName()

The name of the option (without the -- prefix).

public boolean
required()

Whether or not the option is required.

public String
shortName()

The short option name (without the - prefix).

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Field Detail

NO_NAMEback to summary
public static final String NO_NAME

Method Detail

acceptMultipleValuesback to summary
public boolean acceptMultipleValues()

Whether or not the option accept multiple values. If the setter accepts an array, a list, a set, or a collection as parameter, it automatically detect it accepts multiple values.

acceptValueback to summary
public boolean acceptValue()

Whether or not the option accept a value. If the setter accepts an array, a list, a set, or a collection as parameter, it automatically detect it accepts multiple values.

argNameback to summary
public String argName()

The name of this argument (used in doc)

choicesback to summary
public String[] choices()

The set of choices accepted as values by this option. No need to call this methods for enums.

flagback to summary
public boolean flag()

Whether or not the option can be used as a flag (meaning no value)

helpback to summary
public boolean help()

Whether or not this option is a "Help" option. Help options are generally flag.

longNameback to summary
public String longName()

The name of the option (without the -- prefix). Defaults to a name based on the setter name

requiredback to summary
public boolean required()

Whether or not the option is required.

shortNameback to summary
public String shortName()

The short option name (without the - prefix). If not given the option has no short name.