Annotation Type Attribute


  • @SupportedAll
    @Retention(RUNTIME)
    @Target(METHOD)
    public @interface Attribute
    Indicates that a method describes a configuration attribute of an SMS service.

    The annotated method MUST NOT have any parameters. The annotated method MAY have a default implementation, which will be used to determine the default value for the attribute.

    The schema created for a particular annotated method is controlled by a TypeAdapter. The adapter for a method is chosen as follows:

    1. If the method has an annotation that implies a TypeAdapter, it is used.
    2. Otherwise, the TypeAdapter is inferred from the return type of the method.
    See Also:
    Config
    • Field Summary

      Fields 
      Modifier and Type Fields Description
      static int HIDDEN
      Used to set an attribute as "hidden" so it is not exposed via UI.
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      int order
      Used to determine the position of the attribute when the service configuration is presented to a user.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      Class<?> choiceValuesClass
      A com.sun.identity.sm.ChoiceValues implementation that should be used to compute the choice values for the attribute.
      boolean hiddenFromConfigUi
      Whether the config attribute should be hidden from the config UI.
      String i18nKey
      The key to use in the resource bundle.
      int minLength
      Specify that the attribute value cannot be empty.
      String name
      The name of the attribute.
      boolean requiredValue
      Specify that the attribute is required to have a value.
      String resourceName
      The resource name of the attribute in the REST endpoints.
      Class<?>[] validators
      A list of ServiceAttributeValidator classes that will validate the value of the attribute.
    • Field Detail

      • HIDDEN

        static final int HIDDEN
        Used to set an attribute as "hidden" so it is not exposed via UI.
    • Element Detail

      • order

        int order
        Used to determine the position of the attribute when the service configuration is presented to a user.
        Returns:
        the order.
      • name

        String name
        The name of the attribute. If not provided, the name of the annotated method is used.
        Returns:
        the name.
        Default:
        ""
      • resourceName

        String resourceName
        The resource name of the attribute in the REST endpoints. If not provided, the name of the attribute is used.
        Returns:
        the resource name.
        See Also:
        name()
        Default:
        ""
      • i18nKey

        String i18nKey
        The key to use in the resource bundle. If not provided, the name of the attribute is used.
        Returns:
        the i18n key.
        See Also:
        name()
        Default:
        ""
      • validators

        Class<?>[] validators
        A list of ServiceAttributeValidator classes that will validate the value of the attribute. If not provided, no validation will be performed.
        Returns:
        the validator classes.
        Default:
        {}
      • choiceValuesClass

        Class<?> choiceValuesClass
        A com.sun.identity.sm.ChoiceValues implementation that should be used to compute the choice values for the attribute.
        Returns:
        The choice values class.
        Default:
        java.lang.Void.class
      • requiredValue

        boolean requiredValue
        Specify that the attribute is required to have a value. This will add the com.sun.identity.sm.RequiredValueValidator validator.
        Returns:
        if a value is required.
        Default:
        false
      • minLength

        int minLength
        Specify that the attribute value cannot be empty.
        Returns:
        the minimum length of the value. -1 if not specified.
        Default:
        -1
      • hiddenFromConfigUi

        boolean hiddenFromConfigUi
        Whether the config attribute should be hidden from the config UI. Defaults to false.
        Returns:
        true if the attribute should be hidden.
        Default:
        false