Package org.infinispan.cdi.common.util
Class ImmutableInjectionPoint
- java.lang.Object
-
- org.infinispan.cdi.common.util.ImmutableInjectionPoint
-
- All Implemented Interfaces:
InjectionPoint
public class ImmutableInjectionPoint extends Object implements 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
Constructors Constructor Description 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.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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AnnotatedgetAnnotated()Obtain 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.MembergetMember()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.Set<Annotation>getQualifiers()Get the required qualifiers of the injection point.TypegetType()Get the required type of injection point.booleanisDelegate()Determines if the injection point is a decorator delegate injection point.booleanisTransient()Determines if the injection is a transient field.
-
-
-
Constructor Detail
-
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 Detail
-
getAnnotated
public Annotated 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
public Bean<?> 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
public Member 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
public Set<Annotation> getQualifiers()
Description copied from interface:InjectionPointGet the required qualifiers of the injection point.- Specified by:
getQualifiersin interfaceInjectionPoint- Returns:
- the required qualifiers
-
getType
public Type 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
-
-