Annotation Interface Option
Annotation to define options for command arguments.
This annotation can be used multiple times on the same method.
The value() method represents the key of the option,
and the prefix() method defines the default prefix for options,
which is -- by default.
Additional separators can be customized using the valueSeparator()
and keySeparator() methods. By default, the value separator is
a comma (,), and the key separator is an equals sign (=).
The allowSeparating() method controls whether separating values
is allowed, with the default set to true.
The Option.OptionContainer is a container annotation that allows
the Option annotation to be repeatable on methods.
- Author:
- Despical
Created at 20.09.2024
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interfaceContainer annotation for holding multipleOptionannotations on the same method. -
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanDetermines whether separating multiple values is allowed.Specifies the separator between key and value.Specifies the prefix for the options.Specifies the separator used between values.
-
Element Details
-
value
String valueSpecifies the key of the option.- Returns:
- the option key
-
prefix
String prefixSpecifies the prefix for the options. Default is "--".- Returns:
- the option prefix
- Default:
"--"
-
valueSeparator
String valueSeparatorSpecifies the separator used between values. Default is a comma ",".- Returns:
- the value separator
- Default:
","
-
keySeparator
String keySeparatorSpecifies the separator between key and value. Default is "=".- Returns:
- the key-value separator
- Default:
"="
-
allowSeparating
boolean allowSeparatingDetermines whether separating multiple values is allowed. Default istrue.- Returns:
trueif separating is allowed,falseotherwise
- Default:
true
-