Package org.apache.sis.console
Enum Option
- All Implemented Interfaces:
Serializable
,Comparable<Option>
,java.lang.constant.Constable
A command-line option.
- Since:
- 0.3
- Version:
- 0.7
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionWhether the output should contain only brief information.Whether colorized output shall be enabled.Whether to print the full stack trace in case of error.The encoding for the output produced by the command.The output format.Lists the options accepted by a command.The locale for the output produced by the command.The Coordinate Reference System of input data.The Coordinate Reference System of input data.The timezone for the dates to be formatted.Whether the output should contain more detailed information. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String[]
Boolean values accepted on the command line.(package private) final boolean
Whether this option expects a value.private String
The string representation of this option, as used on the command line.(package private) static final String
The prefix to prepend to option names. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static Option
Returns the option for the given string.(package private) String
label()
Return the string representation as used on the command line.(package private) boolean
parseBoolean
(String value) Parses the given value as a boolean.static Option
Returns the enum constant of this type with the specified name.static Option[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
SOURCE_CRS
The Coordinate Reference System of input data. -
TARGET_CRS
The Coordinate Reference System of input data. -
FORMAT
The output format. Examples:"xml"
,"text"
. -
LOCALE
The locale for the output produced by the command. -
TIMEZONE
The timezone for the dates to be formatted. -
ENCODING
The encoding for the output produced by the command. -
COLORS
Whether colorized output shall be enabled. -
BRIEF
Whether the output should contain only brief information. This option expects no value. -
VERBOSE
Whether the output should contain more detailed information. This option expects no value. -
DEBUG
Whether to print the full stack trace in case of error. This option expects no value. -
HELP
Lists the options accepted by a command.
-
-
Field Details
-
PREFIX
The prefix to prepend to option names.- See Also:
-
BOOLEAN_VALUES
Boolean values accepted on the command line. Values at even indices arefalse
and values at odd indices aretrue
.- See Also:
-
label
The string representation of this option, as used on the command line. This is usually the lower-case version ofEnum.name()
.- See Also:
-
hasValue
final boolean hasValueWhether this option expects a value.
-
-
Constructor Details
-
Option
private Option(boolean hasValue) Creates a new option.- Parameters:
hasValue
- whether this option expects a value.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
label
String label()Return the string representation as used on the command line. -
forLabel
Returns the option for the given string.- Throws:
InvalidOptionException
-
parseBoolean
Parses the given value as a boolean.- Parameters:
value
- the value to parse.- Returns:
- the value as a boolean.
- Throws:
InvalidOptionException
- if the given value is not recognized as a boolean.
-