Module com.github.rvesse.airline
Annotation Type Option
-
@Retention(RUNTIME) @Target(FIELD) @Documented public @interface Option
Annotation to mark a field as an option
-
-
Required Element Summary
Required Elements Modifier and Type Required Element Description java.lang.String[]
name
An array of allowed command line parameters e.g.
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description int
arity
How many parameter values this option will consume.java.lang.String
description
A description of this option.boolean
hidden
If true, this parameter won't appear in the usage().boolean
override
If true this parameter can override parameters of the same name (set via thename()
property) declared by parent classes assuming the option definitions are compatible.boolean
sealed
If true this parameter cannot be overridden by parameters of the same name declared in child classes regardless of whether the child class declares theoverride()
property to be truejava.lang.String[]
title
Name use to identify the option value in documentation and error messagesOptionType
type
Is this a command, group or global optionjava.lang.Class<? extends TypeConverterProvider>
typeConverterProvider
Sets an alternative type converter provider for the option.
-
-
-
-
type
OptionType type
Is this a command, group or global option- Returns:
- Option type
- Default:
- com.github.rvesse.airline.annotations.OptionType.COMMAND
-
-
-
title
java.lang.String[] title
Name use to identify the option value in documentation and error messagesIf your option has
arity()
greater than 1 then you can specify titles for each parameter by specifying an array of titles. If there are fewer titles than the arity then the last title in the list will be used for all subsequent options- Returns:
- Title
- Default:
- {""}
-
-
hidden
boolean hidden
If true, this parameter won't appear in the usage().- Returns:
- True if hidden, false otherwise
- Default:
- false
-
-
-
override
boolean override
If true this parameter can override parameters of the same name (set via thename()
property) declared by parent classes assuming the option definitions are compatible.See
OptionMetadata.override(java.util.Set, OptionMetadata, OptionMetadata)
for legal overridesNote that where the child option definition is an exact duplicate of the parent then overriding is implicitly permitted
- Returns:
- True if an override, false otherwise
- Default:
- false
-
-
-
sealed
boolean sealed
If true this parameter cannot be overridden by parameters of the same name declared in child classes regardless of whether the child class declares theoverride()
property to be true- Returns:
- True if sealed, false otherwise
- Default:
- false
-
-
-
typeConverterProvider
java.lang.Class<? extends TypeConverterProvider> typeConverterProvider
Sets an alternative type converter provider for the option. This allows the type converter for an option to be customised appropriately. By default this will defer to using the type converter provided in the parser configuration.- Returns:
- Type converter provider
- Default:
- com.github.rvesse.airline.types.DefaultTypeConverterProvider.class
-
-