Annotation Type Configured


  • @Documented
    @Retention(RUNTIME)
    @Target({FIELD,PARAMETER})
    @InjectionPointIndicator
    public @interface Configured
    This annotation is placed on fields or on parameters of methods or constructors to indicate that these fields or parameters should come from the configuration instance of the type defined by the ConfiguredBy annotation on the class.

    The key field gives the name of the parameter to get from the java bean instance upon which the instance of this service is based. If the configuration bean is a java bean then a method name starting with "get" and having the key name (with the first letter capitalized) will be invoked to get the value. if the configuration bean is a map then the value of the key is the value of the key in the map from which to get the value

    In the case of a field the key field can come from the name of the field (or can be explicitly set, which will override the name of the field). In the case of a parameter the key field must be filled in with the name of the field on the java bean to use to inject into this parameter

    Author:
    jwells
    • Field Summary

      Fields 
      Modifier and Type Fields Description
      static String BEAN_KEY
      This value can be used to indicate that the injection point should be the whole bean
      static String INSTANCE
      This value can be used to indicate that the injection point should be given the instance name.
      static String TYPE
      This value can be used to indicate that the injection point should be given the type name.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      Dynamicity dynamicity
      Describes how dynamic a configured field or parameter must be.
      String value
      The name of the field in the java bean or bean-like map to use for injecting into this field or parameter.
    • Field Detail

      • BEAN_KEY

        static final String BEAN_KEY
        This value can be used to indicate that the injection point should be the whole bean
      • INSTANCE

        static final String INSTANCE
        This value can be used to indicate that the injection point should be given the instance name. The injection point must be of type String
      • TYPE

        static final String TYPE
        This value can be used to indicate that the injection point should be given the type name. The injection point must be of type String
    • Element Detail

      • value

        String value
        The name of the field in the java bean or bean-like map to use for injecting into this field or parameter. If this field is set to "$bean" then the whole bean upon which this instance is based will be injected into this location
        Returns:
        The name of the field to use for injecting into this field or parameter
        Default:
        ""
      • dynamicity

        Dynamicity dynamicity
        Describes how dynamic a configured field or parameter must be. All parameters of a constructor must be STATIC. All parameters of a method must have the same dynamicity value
        Returns:
        The dynamicicty of this field or parameter
        Default:
        org.glassfish.hk2.configuration.api.Dynamicity.STATIC