Module com.github.rvesse.airline
Annotation Interface Option
Annotation to mark a field as an option
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionint
How many parameter values this option will consume.A description of this option.boolean
If true, this parameter won't appear in the usage().boolean
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
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 trueString[]
Name use to identify the option value in documentation and error messagesIs this a command, group or global optionClass
<? extends TypeConverterProvider> Sets an alternative type converter provider for the option.
-
Element Details
-
type
OptionType typeIs this a command, group or global option- Returns:
- Option type
- Default:
COMMAND
-
title
String[] titleName 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:
{""}
-
name
String[] nameAn array of allowed command line parameters e.g.-n
,--name
, etc...- Returns:
- Names
-
description
String descriptionA description of this option.- Returns:
- Description
- Default:
""
-
arity
int arityHow many parameter values this option will consume. For example, an arity of 2 will allow-pair value1 value2
- Returns:
- Arity
- Default:
-2147483648
-
override
boolean overrideIf 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 sealedIf 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
Class<? extends TypeConverterProvider> typeConverterProviderSets 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
-