Annotation Interface Reference


@Documented @Qualifier @Retention(RUNTIME) @Target({FIELD,PARAMETER}) public @interface Reference
Annotation used on injection points informing the CDI container that the injection should apply a service obtained from the OSGi registry.

*

See Also:
  • "Reference Annotation"
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    A marker type used in value() to indicate that a reference injection point may accept any service type(s).
    static final class 
    Support inline instantiation of the Reference annotation.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The target property for this reference.
    Specify the type of the service for this reference.
  • Element Details

    • value

      Class<?> value
      Specify the type of the service for this reference.

      If not specified, the type of the service for this reference is derived from the injection point type.

      If a value is specified it must be type compatible with (assignable to) the service type derived from the injection point type, otherwise a definition error will result.

      Default:
      java.lang.Object.class
    • target

      String target
      The target property for this reference.

      If not specified, no target property is set.

      Default:
      ""