Enum Option

java.lang.Object
java.lang.Enum<Option>
org.apache.sis.console.Option
All Implemented Interfaces:
Serializable, Comparable<Option>, java.lang.constant.Constable

enum Option extends Enum<Option>
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 Constants
    Enum Constant
    Description
    Whether 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

    Fields
    Modifier and Type
    Field
    Description
    private 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
    Modifier
    Constructor
    Description
    private
    Option(boolean hasValue)
    Creates a new option.
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) static Option
    Returns the option for the given string.
    (package private) String
    Return the string representation as used on the command line.
    (package private) boolean
    Parses the given value as a boolean.
    static Option
    Returns the enum constant of this type with the specified name.
    static Option[]
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • SOURCE_CRS

      public static final Option SOURCE_CRS
      The Coordinate Reference System of input data.
    • TARGET_CRS

      public static final Option TARGET_CRS
      The Coordinate Reference System of input data.
    • FORMAT

      public static final Option FORMAT
      The output format. Examples: "xml", "text".
    • LOCALE

      public static final Option LOCALE
      The locale for the output produced by the command.
    • TIMEZONE

      public static final Option TIMEZONE
      The timezone for the dates to be formatted.
    • ENCODING

      public static final Option ENCODING
      The encoding for the output produced by the command.
    • COLORS

      public static final Option COLORS
      Whether colorized output shall be enabled.
    • BRIEF

      public static final Option BRIEF
      Whether the output should contain only brief information. This option expects no value.
    • VERBOSE

      public static final Option VERBOSE
      Whether the output should contain more detailed information. This option expects no value.
    • DEBUG

      public static final Option DEBUG
      Whether to print the full stack trace in case of error. This option expects no value.
    • HELP

      public static final Option HELP
      Lists the options accepted by a command.
  • Field Details

    • PREFIX

      static final String PREFIX
      The prefix to prepend to option names.
      See Also:
    • BOOLEAN_VALUES

      private static final String[] BOOLEAN_VALUES
      Boolean values accepted on the command line. Values at even indices are false and values at odd indices are true.
      See Also:
    • label

      private String label
      The string representation of this option, as used on the command line. This is usually the lower-case version of Enum.name().
      See Also:
    • hasValue

      final boolean hasValue
      Whether 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

      public static Option[] 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

      public static Option valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • label

      String label()
      Return the string representation as used on the command line.
    • forLabel

      static Option forLabel(String label) throws InvalidOptionException
      Returns the option for the given string.
      Throws:
      InvalidOptionException
    • parseBoolean

      boolean parseBoolean(String value) throws InvalidOptionException
      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.