Annotation Type Param


  • @Retention(RUNTIME)
    @Target({METHOD,FIELD})
    public @interface Param
    Param is a parameter to a command. This annotation can be placed on a field or setter method to identify the parameters of a command and have those parameters injected by the system before the command is executed. The system will check that all non optional parameters are satisfied before invoking the command.
    Author:
    Jerome Dochez
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      String acceptableValues
      Returns a list of comma separated acceptable values for this parameter.
      String alias
      Returns an alias for the option.
      Class<? extends ParamDefaultCalculator> defaultCalculator
      Returns a class that calculates the default value associated with the parameter.
      String defaultValue
      Returns the default value associated with the parameter so that the user can specify
      boolean multiple
      Returns true if multiple instances of the parameter are allowed.
      String name
      Returns the name of the parameter as it has be specified by the client when invoking the command.
      boolean obsolete
      Returns true if this parameter is obsolete.
      boolean optional
      Returns true if the parameter is optional to the successful invocation of the command
      boolean password
      Returns true if the parameter is a password
      boolean primary
      Returns true if this is the primary parameter for the command which mean that the client does not have to pass the parameter name but just the value to the command.
      char separator
      Returns the character used to separate items in a list.
      String shortName
      Returns the short name associated with the parameter so that the user can specify -p as well as -password when invoking the command.
    • Element Detail

      • name

        String name
        Returns the name of the parameter as it has be specified by the client when invoking the command. By default the name is deducted from the name of the annotated element. If the annotated element is a field, it is the filed name. If the annotated element is a method, it is the JavaBeans property name from the setter method name
        Returns:
        the parameter name.
        Default:
        ""
      • acceptableValues

        String acceptableValues
        Returns a list of comma separated acceptable values for this parameter. The system will check that one of the value is used before invoking the command.
        Returns:
        the list of comma separated acceptable values
        Default:
        ""
      • optional

        boolean optional
        Returns true if the parameter is optional to the successful invocation of the command
        Returns:
        true if the parameter is optional
        Default:
        false
      • shortName

        String shortName
        Returns the short name associated with the parameter so that the user can specify -p as well as -password when invoking the command.
        Returns:
        the parameter short name
        Default:
        ""
      • primary

        boolean primary
        Returns true if this is the primary parameter for the command which mean that the client does not have to pass the parameter name but just the value to the command.
        Returns:
        true if this is the primary command parameter.
        Default:
        false
      • defaultValue

        String defaultValue
        Returns the default value associated with the parameter so that the user can specify
        Returns:
        the parameter default value
        Default:
        ""
      • defaultCalculator

        Class<? extends ParamDefaultCalculator> defaultCalculator
        Returns a class that calculates the default value associated with the parameter.
        Returns:
        a parameter default value calculator
        Default:
        org.glassfish.api.ParamDefaultCalculator.class
      • password

        boolean password
        Returns true if the parameter is a password
        Returns:
        true if the parameter is password
        Default:
        false
      • separator

        char separator
        Returns the character used to separate items in a list. Applies to parameters of type List, Properties, and String[]. The default separator is comma.
        Returns:
        the separator character
        Default:
        ','
      • multiple

        boolean multiple
        Returns true if multiple instances of the parameter are allowed.
        Returns:
        true if multiple instances are allowed
        Default:
        false
      • obsolete

        boolean obsolete
        Returns true if this parameter is obsolete. Obsolete parameters produce warnings when used in asadmin, are ignored, and are not included in the command usage.
        Returns:
        true if the parameter is obsolete
        Default:
        false
      • alias

        String alias
        Returns an alias for the option. This supports renaming options and supporting both the old name and the new name.
        Returns:
        the parameter alias
        Default:
        ""