@IgnoreInWholeProgramInference
@Retention(value=RUNTIME)
@Target(value=FIELD)
public @interface Option
Here are examples of use:
@Option("-o <filename> the output file ") public static File outfile = new File("/tmp/foobar"); @Option("-i ignore case") public static boolean ignore_case; @Option("set the initial temperature") public static double temperature = 75.0;See the documentation for the elements of this annotation (just below).
Also see the documentation for the Options
class, which processes
the command-line options.
Options
,
OptionGroup
,
Unpublicized
,
OptionsDoclet
Modifier and Type | Required Element and Description |
---|---|
java.lang.String |
value
A string that describes the option.
|
Modifier and Type | Optional Element and Description |
---|---|
java.lang.String[] |
aliases
Aliases for this option, which a user can use instead of the option's standard name.
|
boolean |
noDocDefault
If true,
OptionsDoclet does not report the field's default value. |
public abstract java.lang.String value
[-c] [<type>] description
":
<type>
" is an optional description of the option type, to be displayed instead
of its Java type (e.g., "<filename>
" if the variable's type is String). The
less-than and greater-than symbols are required.
@Option
description.
Option
public abstract java.lang.String[] aliases
Each string includes leading hyphens, as in
@Option(value = "Print the program version", aliases = {"-v", "-version", "--version"})
If there is only a single, one-character alias, it can be put at the beginning of the value
field without the need for an aliases
element.
For more information about the use of this field, see the section on "Option aliases" in
Options
.
public abstract boolean noDocDefault
OptionsDoclet
does not report the field's default value.