Top Description Methods
javax.enterprise.inject.spi

public Interface InjectionPoint

Imports
java.lang.annotation.Annotation, java.lang.reflect.Member, .Type, java.util.Set, javax.enterprise.inject.Instance

Provides access to metadata about an injection point. May represent an injected field or a parameter of a bean constructor, initializer method, producer method, disposer method or observer method.

If the injection point is a dynamically selected reference obtained then the metadata obtain reflects the injection point of the Instance, with the required type and any additional required qualifiers defined by Instance.select().

Occasionally, a bean with scope @Dependent needs to access metadata relating to the object to which it belongs. The bean may inject an InjectionPoint representing the injection point into which the bean was injected.

For example, the following producer method creates injectable Logger s. The log category of a Logger depends upon the class of the object into which it is injected.

@Produces
Logger createLogger(InjectionPoint injectionPoint) {
    return Logger.getLogger(injectionPoint.getMember().getDeclaringClass().getName());
}

Only dependent objects, may obtain information about the injection point to which they belong.

Authors
Gavin King, Pete Muir

Method Summary

Modifier and TypeMethod and Description
public Annotated

Returns:

an AnnotatedField or AnnotatedParameter
getAnnotated
()

Obtain an instance of javax.enterprise.inject.spi.AnnotatedField or javax.enterprise.inject.spi.AnnotatedParameter, depending upon whether the injection point is an injected field or a constructor/method parameter.

public Bean<?>

Returns:

the javax.enterprise.inject.spi.Bean object representing bean that defines the injection point, of null if the injection point does not belong to a bean
getBean
()

Get the javax.enterprise.inject.spi.Bean object representing the bean that defines the injection point.

public Member

Returns:

the member
getMember
()

Get the java.lang.reflect.Field object in the case of field injection, the java.lang.reflect.Method object in the case of method parameter injection or the java.lang.reflect.Constructor object in the case of constructor parameter injection.

public Set<Annotation>

Returns:

the required qualifiers
getQualifiers
()

Get the required qualifiers of the injection point.

public Type

Returns:

the required type
getType
()

Get the required type of injection point.

public boolean

Returns:

true if the injection point is a decorator delegate injection point, and false otherwise
isDelegate
()

Determines if the injection point is a decorator delegate injection point.

public boolean

Returns:

true if the injection point is a transient field, and false otherwise
isTransient
()

Determines if the injection is a transient field.

Method Detail

getAnnotatedback to summary
public Annotated getAnnotated()

Obtain an instance of javax.enterprise.inject.spi.AnnotatedField or javax.enterprise.inject.spi.AnnotatedParameter, depending upon whether the injection point is an injected field or a constructor/method parameter.

Returns:Annotated

an AnnotatedField or AnnotatedParameter

getBeanback to summary
public Bean<?> getBean()

Get the javax.enterprise.inject.spi.Bean object representing the bean that defines the injection point. If the injection point does not belong to a bean, return a null value.

Returns:Bean<?>

the javax.enterprise.inject.spi.Bean object representing bean that defines the injection point, of null if the injection point does not belong to a bean

getMemberback to summary
public Member getMember()

Get the java.lang.reflect.Field object in the case of field injection, the java.lang.reflect.Method object in the case of method parameter injection or the java.lang.reflect.Constructor object in the case of constructor parameter injection.

Returns:Member

the member

getQualifiersback to summary
public Set<Annotation> getQualifiers()

Get the required qualifiers of the injection point.

Returns:Set<Annotation>

the required qualifiers

getTypeback to summary
public Type getType()

Get the required type of injection point.

Returns:Type

the required type

isDelegateback to summary
public boolean isDelegate()

Determines if the injection point is a decorator delegate injection point.

Returns:boolean

true if the injection point is a decorator delegate injection point, and false otherwise

isTransientback to summary
public boolean isTransient()

Determines if the injection is a transient field.

Returns:boolean

true if the injection point is a transient field, and false otherwise