Package org.jboss.weld.injection
Class MethodInjectionPoint<T,X>
- java.lang.Object
-
- org.jboss.weld.injection.MethodInjectionPoint<T,X>
-
- Type Parameters:
T- the return type of the methodX- the type of the class that declared the method
- All Implemented Interfaces:
InjectionPoint,WeldInjectionPointAttributes<T,Method>
public abstract class MethodInjectionPoint<T,X> extends Object
Wraps a method whose parameters may be injected.- Author:
- Jozef Hartinger
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMethodInjectionPoint.MethodInjectionPointType
-
Field Summary
Fields Modifier and Type Field Description protected booleanhasTransientReferenceParameterprotected MethodInjectionPoint.MethodInjectionPointTypetype
-
Constructor Summary
Constructors Modifier Constructor Description protectedMethodInjectionPoint(MethodInjectionPoint.MethodInjectionPointType methodInjectionPointType, EnhancedAnnotatedCallable<T,X,Method> callable, Bean<?> declaringBean, Class<?> declaringComponentClass, InjectionPointFactory factory, BeanManagerImpl manager)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)abstract AnnotatedMethod<X>getAnnotated()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.Set<InjectionPoint>getInjectionPoints()Returns a set ofInjectionPointinstances of this constructor/method.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.List<ParameterInjectionPoint<?,X>>getParameterInjectionPoints()<A extends Annotation>
AgetQualifier(Class<A> annotationType)Returns an instance of a given qualifier annotation or null if a given qualifier is not present on the injection point.Set<Annotation>getQualifiers()Get the required qualifiers of the injection point.TypegetType()Get the required type of injection point.inthashCode()abstract Tinvoke(Object receiver, Object specialValue, BeanManagerImpl manager, CreationalContext<?> ctx, Class<? extends RuntimeException> exceptionTypeToThrow)Invokes the method.booleanisDelegate()Determines if the injection point is a decorator delegate injection point.booleanisTransient()Determines if the injection is a transient field.StringtoString()
-
-
-
Field Detail
-
type
protected MethodInjectionPoint.MethodInjectionPointType type
-
hasTransientReferenceParameter
protected final boolean hasTransientReferenceParameter
-
-
Constructor Detail
-
MethodInjectionPoint
protected MethodInjectionPoint(MethodInjectionPoint.MethodInjectionPointType methodInjectionPointType, EnhancedAnnotatedCallable<T,X,Method> callable, Bean<?> declaringBean, Class<?> declaringComponentClass, InjectionPointFactory factory, BeanManagerImpl manager)
-
-
Method Detail
-
invoke
public abstract T invoke(Object receiver, Object specialValue, BeanManagerImpl manager, CreationalContext<?> ctx, Class<? extends RuntimeException> exceptionTypeToThrow)
Invokes the method.- Parameters:
receiver- the instance to receive the method invocation or null if this is a static methodspecialValue- value to be passed to the special parameter (observer or disposer parameter) or null if the method is not an observer or disposermanager- the bean managerctx- the creational contextexceptionTypeToThrow- exception type to be used to wrap potential exceptions within- Returns:
- the value returned from the method
-
getAnnotated
public abstract AnnotatedMethod<X> 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
-
getType
public Type getType()
Description copied from interface:InjectionPointGet the required type of injection point.- Specified by:
getTypein interfaceInjectionPoint- Returns:
- the required type
-
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
-
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
-
isDelegate
public boolean isDelegate()
Description copied from interface:InjectionPointDetermines if the injection point is a decorator delegate injection point.- Specified by:
isDelegatein interfaceInjectionPoint- Returns:
- true if the injection point is a decorator delegate injection point, and false otherwise
-
isTransient
public boolean isTransient()
Description copied from interface:InjectionPointDetermines if the injection is a transient field.- Specified by:
isTransientin interfaceInjectionPoint- Returns:
- true if the injection point is a transient field, and false otherwise
-
getQualifier
public <A extends Annotation> A getQualifier(Class<A> annotationType)
Description copied from interface:WeldInjectionPointAttributesReturns an instance of a given qualifier annotation or null if a given qualifier is not present on the injection point.- Specified by:
getQualifierin interfaceWeldInjectionPointAttributes<T,X>
-
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
-
getParameterInjectionPoints
public List<ParameterInjectionPoint<?,X>> getParameterInjectionPoints()
-
getInjectionPoints
public Set<InjectionPoint> getInjectionPoints()
Returns a set ofInjectionPointinstances of this constructor/method. This set never contains aSpecialParameterInjectionPointand is therefore suitable for use outside of Weld. The returned set is immutable.
-
-