Annotation Interface Argument


@Retention(RUNTIME) @Target(PARAMETER) public @interface Argument
Annotation to mark command line arguments of a command.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Default value of the argument (string representation).
    Argument help message or the variable name from the Messages class from the same package as the command.
    Collection argument type.
    Argument name and aliases which must start with the hyphen character.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Special value which means a value is not provided.
  • Field Details

  • Element Details

    • value

      String[] value
      Argument name and aliases which must start with the hyphen character. If empty, this is a keyless (positional) argument. At most one of those is allowed per command, and it must be the last one.
      Default:
      {}
    • descriptor

      String descriptor
      Argument help message or the variable name from the Messages class from the same package as the command. In the later case, NLS is used to produce localized help message.
      Default:
      ""
    • defaultValue

      String defaultValue
      Default value of the argument (string representation). If this value is UNSPECIFIED, the argument is required. If this value is specified, the argument is not required, in which case if it's not provided, this value (converted to the Argument's actual type) will be passed to the method.
      Default:
      "com.e1c.g5.v8.dt.cli.api.unspecified.argument"
    • elementType

      Class<?> elementType
      Collection argument type. Due to limitations of Java types of collection elements aren't acccesible in runtime so we need to provide types for collection arguments
      Default:
      java.lang.Object.class