Annotation Interface Option


@Retention(RUNTIME) @Target(PARAMETER) @Documented public @interface Option
Annotation marking a method parameter to be a candicate for an option.
  • Element Details

    • longNames

      String[] longNames
      Long names of an option. There can be multiple names where first is primary one and other are aliases.
      Returns:
      Option long names, defaults to empty.
      Default:
      {}
    • shortNames

      char[] shortNames
      Short names of an option. There can be multiple names where first is primary one and other are aliases.
      Returns:
      Option short names, defaults to empty.
      Default:
      {}
    • required

      boolean required
      Mark option required.
      Returns:
      true if option is required, defaults to false.
      Default:
      false
    • defaultValue

      String defaultValue
      Define option default value.
      Returns:
      default value
      Default:
      ""
    • description

      String description
      Return a short description of the option.
      Returns:
      description of the option
      Default:
      ""
    • label

      String label
      Return a label of the option.
      Returns:
      label of the option
      Default:
      ""
    • arity

      Define option arity.
      Returns:
      option arity
      See Also:
      Default:
      NONE
    • arityMin

      int arityMin
      Define option arity min. If Defined non-negative will be used instead of arity(). If arityMax is not set non-negative it is set to same as this.
      Returns:
      option arity min
      See Also:
      Default:
      -1
    • arityMax

      int arityMax
      Define option arity max. If Defined non-negative will be used instead of arity(). If arityMin is not set non-negative it is set to zero.
      Returns:
      option arity max
      See Also:
      Default:
      -1