Search in sources :

Example 11 with InjectionPoint

use of javax.enterprise.inject.spi.InjectionPoint in project deltaspike by apache.

the class BeanUtils method createInjectionPoints.

/**
     * Given a method, and the bean on which the method is declared, create a
     * collection of injection points representing the parameters of the method.
     *
     * @param <X>           the type declaring the method
     * @param method        the method
     * @param declaringBean the bean on which the method is declared
     * @param beanManager   the bean manager to use to create the injection points
     * @return the injection points
     */
public static <X> List<InjectionPoint> createInjectionPoints(AnnotatedMethod<X> method, Bean<?> declaringBean, BeanManager beanManager) {
    List<InjectionPoint> injectionPoints = new ArrayList<InjectionPoint>();
    for (AnnotatedParameter<X> parameter : method.getParameters()) {
        InjectionPoint injectionPoint = new ImmutableInjectionPoint(parameter, beanManager, declaringBean, false, false);
        injectionPoints.add(injectionPoint);
    }
    return injectionPoints;
}
Also used : ImmutableInjectionPoint(org.apache.deltaspike.core.util.metadata.builder.ImmutableInjectionPoint) InjectionPoint(javax.enterprise.inject.spi.InjectionPoint) ArrayList(java.util.ArrayList) ImmutableInjectionPoint(org.apache.deltaspike.core.util.metadata.builder.ImmutableInjectionPoint)

Aggregations

InjectionPoint (javax.enterprise.inject.spi.InjectionPoint)11 ImmutableInjectionPoint (org.apache.deltaspike.core.util.metadata.builder.ImmutableInjectionPoint)3 Field (java.lang.reflect.Field)2 Method (java.lang.reflect.Method)2 HashSet (java.util.HashSet)2 Annotated (javax.enterprise.inject.spi.Annotated)2 Decorator (javax.enterprise.inject.spi.Decorator)2 ProcessInjectionPoint (javax.enterprise.inject.spi.ProcessInjectionPoint)2 BeanBuilder (org.apache.deltaspike.core.util.bean.BeanBuilder)2 CurrentInjectionPoint (org.jboss.weld.injection.CurrentInjectionPoint)2 EmptyInjectionPoint (org.jboss.weld.injection.EmptyInjectionPoint)2 Test (org.junit.Test)2 Member (java.lang.reflect.Member)1 AbstractMap (java.util.AbstractMap)1 ArrayList (java.util.ArrayList)1 Set (java.util.Set)1 Resource (javax.annotation.Resource)1 AnnotatedField (javax.enterprise.inject.spi.AnnotatedField)1 InjectionTarget (javax.enterprise.inject.spi.InjectionTarget)1 ProcessInjectionTarget (javax.enterprise.inject.spi.ProcessInjectionTarget)1