Package org.infinispan.cdi.common.util
Class ImmutableInjectionPoint
java.lang.Object
org.infinispan.cdi.common.util.ImmutableInjectionPoint
- All Implemented Interfaces:
InjectionPoint
A base class for implementing InjectionPoint. The attributes are
immutable, and collections are defensively copied on instantiation.
- Author:
- Stuart Douglas, Pete Muir
-
Constructor Summary
ConstructorsConstructorDescriptionImmutableInjectionPoint(AnnotatedField<?> field, BeanManager beanManager, Bean<?> declaringBean, boolean _transient, boolean delegate) Instantiate a newInjectionPointbased upon anAnnotatedField, reading the qualifiers from the annotations declared on the field.ImmutableInjectionPoint(AnnotatedField<?> field, Set<Annotation> qualifiers, Bean<?> declaringBean, boolean _transient, boolean delegate) Instantiate a newInjectionPointbased upon anAnnotatedField.ImmutableInjectionPoint(AnnotatedParameter<?> parameter, BeanManager beanManager, Bean<?> declaringBean, boolean _transient, boolean delegate) Instantiate a newInjectionPointbased upon anAnnotatedParameter, reading the qualifiers from the annotations declared on the parameter.ImmutableInjectionPoint(AnnotatedParameter<?> parameter, Set<Annotation> qualifiers, Bean<?> declaringBean, boolean _transient, boolean delegate) Instantiate a newInjectionPointbased upon anAnnotatedParameter. -
Method Summary
Modifier and TypeMethodDescriptionObtain an instance ofAnnotatedFieldorAnnotatedParameter, depending upon whether the injection point is an injected field or a constructor/method parameter.Bean<?>getBean()Get theBeanobject representing the bean that defines the injection point.Get theFieldobject in the case of field injection, theMethodobject in the case of method parameter injection or theConstructorobject in the case of constructor parameter injection.Get the required qualifiers of the injection point.getType()Get the required type of injection point.booleanDetermines if the injection point is a decorator delegate injection point.booleanDetermines if the injection is a transient field.
-
Constructor Details
-
ImmutableInjectionPoint
public ImmutableInjectionPoint(AnnotatedField<?> field, Set<Annotation> qualifiers, Bean<?> declaringBean, boolean _transient, boolean delegate) Instantiate a newInjectionPointbased upon anAnnotatedField.- Parameters:
field- the field for which to create the injection pointqualifiers- the qualifiers on the injection pointdeclaringBean- the declaringBean declaring the injection point_transient-trueif the injection point is transientdelegate-trueif the injection point is a delegate injection point on a decorator
-
ImmutableInjectionPoint
public ImmutableInjectionPoint(AnnotatedField<?> field, BeanManager beanManager, Bean<?> declaringBean, boolean _transient, boolean delegate) Instantiate a newInjectionPointbased upon anAnnotatedField, reading the qualifiers from the annotations declared on the field.- Parameters:
field- the field for which to create the injection pointdeclaringBean- the declaringBean declaring the injection point_transient-trueif the injection point is transientdelegate-trueif the injection point is a delegate injection point on a decorator
-
ImmutableInjectionPoint
public ImmutableInjectionPoint(AnnotatedParameter<?> parameter, Set<Annotation> qualifiers, Bean<?> declaringBean, boolean _transient, boolean delegate) Instantiate a newInjectionPointbased upon anAnnotatedParameter.- Parameters:
parameter- the parameter for which to create the injection pointqualifiers- the qualifiers on the injection pointdeclaringBean- the declaringBean declaring the injection point_transient-trueif the injection point is transientdelegate-trueif the injection point is a delegate injection point on a decorator
-
ImmutableInjectionPoint
public ImmutableInjectionPoint(AnnotatedParameter<?> parameter, BeanManager beanManager, Bean<?> declaringBean, boolean _transient, boolean delegate) Instantiate a newInjectionPointbased upon anAnnotatedParameter, reading the qualifiers from the annotations declared on the parameter.- Parameters:
parameter- the parameter for which to create the injection pointdeclaringBean- the declaringBean declaring the injection point_transient-trueif the injection point is transientdelegate-trueif the injection point is a delegate injection point on a decorator
-
-
Method Details
-
getAnnotated
Description copied from interface:InjectionPointObtain an instance ofAnnotatedFieldorAnnotatedParameter, depending upon whether the injection point is an injected field or a constructor/method parameter.- Specified by:
getAnnotatedin interfaceInjectionPoint- Returns:
- an
AnnotatedFieldorAnnotatedParameter
-
getBean
Description copied from interface:InjectionPointGet theBeanobject representing the bean that defines the injection point. If the injection point does not belong to a bean, return a null value.- Specified by:
getBeanin interfaceInjectionPoint- Returns:
- the
Beanobject representing bean that defines the injection point, of null if the injection point does not belong to a bean
-
getMember
Description copied from interface:InjectionPointGet theFieldobject in the case of field injection, theMethodobject in the case of method parameter injection or theConstructorobject in the case of constructor parameter injection.- Specified by:
getMemberin interfaceInjectionPoint- Returns:
- the member
-
getQualifiers
Description copied from interface:InjectionPointGet the required qualifiers of the injection point.- Specified by:
getQualifiersin interfaceInjectionPoint- Returns:
- the required qualifiers
-
getType
Description copied from interface:InjectionPointGet the required type of injection point.- Specified by:
getTypein interfaceInjectionPoint- Returns:
- the required type
-
isDelegate
public boolean isDelegate()Description copied from interface:InjectionPointDetermines if the injection point is a decorator delegate injection point.- Specified by:
isDelegatein interfaceInjectionPoint- Returns:
trueif the injection point is a decorator delegate injection point, andfalseotherwise
-
isTransient
public boolean isTransient()Description copied from interface:InjectionPointDetermines if the injection is a transient field.- Specified by:
isTransientin interfaceInjectionPoint- Returns:
trueif the injection point is a transient field, andfalseotherwise
-