Top Description Inners Methods
org.osgi.service.cdi.annotations

public @Interface Reference

extends Annotation
Known Direct Implementers
org.osgi.service.cdi.annotations.Reference.Literal
Annotations
@Documented
@Qualifier
@Retention:RUNTIME
@Target:FIELD, PARAMETER
Static Imports
java.lang.annotation.ElementType.FIELD, .ElementType.PARAMETER, .RetentionPolicy.RUNTIME

Annotation used on injection points informing the CDI container that the injection should apply a service obtained from the OSGi registry.

*

Author
$Id: bcb5a95650a474eadf267299c486248ce66751b9 $
See Also
Reference Annotation

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Reference.Any

A marker type used in Reference#value to indicate that a reference injection point may accept any service type(s).

public static class
Reference.Literal

Support inline instantiation of the Reference annotation.

Method Summary

Modifier and TypeMethod and Description
public String
target()

The target property for this reference.

public Class<?>
value()

Specify the type of the service for this reference.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

targetback to summary
public String target()

The target property for this reference.

If not specified, no target property is set.

Annotations
@Nonbinding
valueback to summary
public 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.

Annotations
@Nonbinding
org.osgi.service.cdi.annotations back to summary

public final Class Reference.Any

extends Object
Class Inheritance

A marker type used in Reference#value to indicate that a reference injection point may accept any service type(s).

The injection point service type must be specified as Object.

The value must be specified by itself.

For example:

@Inject
@Reference(value = Any.class, target = "(bar=baz)")
List<Object> services;

Constructor Summary

AccessConstructor and Description
public
Any()

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Anyback to summary
public Any()
org.osgi.service.cdi.annotations back to summary

public final Class Reference.Literal

extends AnnotationLiteral<Reference>
implements Reference
Class Inheritance
All Implemented Interfaces
org.osgi.service.cdi.annotations.Reference, java.lang.annotation.Annotation

Support inline instantiation of the Reference annotation.

Field Summary

Modifier and TypeField and Description
private final Class<?>
private final String
private static final long

Constructor Summary

AccessConstructor and Description
private
Literal(Class<?> service, String target)

Method Summary

Modifier and TypeMethod and Description
public static final Reference.Literal

Returns:

instance of Reference
of
(Class<?> service, String target)

public String
target()

Implements org.osgi.service.cdi.annotations.Reference.target.

The target property for this reference.

public Class<?>
value()

Implements org.osgi.service.cdi.annotations.Reference.value.

Specify the type of the service for this reference.

Inherited from javax.enterprise.util.AnnotationLiteral:
annotationTypeequalshashCodetoString

Field Detail

_serviceback to summary
private final Class<?> _service
_targetback to summary
private final String _target
serialVersionUIDback to summary
private static final long serialVersionUID

Hides javax.enterprise.util.AnnotationLiteral.serialVersionUID.

Constructor Detail

Literalback to summary
private Literal(Class<?> service, String target)

Method Detail

ofback to summary
public static final Reference.Literal of(Class<?> service, String target)
Returns:Reference.Literal

instance of Reference

targetback to summary
public String target()

Implements org.osgi.service.cdi.annotations.Reference.target.

Doc from org.osgi.service.cdi.annotations.Reference.target.

The target property for this reference.

If not specified, no target property is set.

Annotations
@Override
valueback to summary
public Class<?> value()

Implements org.osgi.service.cdi.annotations.Reference.value.

Doc from org.osgi.service.cdi.annotations.Reference.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.

Annotations
@Override