Examples of InjectionPoint


Examples of javax.enterprise.inject.spi.InjectionPoint

            {
                //Get parameter annotations
                Annotation[] bindingTypes = AnnotationUtil.getQualifierAnnotations(AnnotationUtil.
                        getAnnotationsFromSet(parameter.getAnnotations()));

                InjectionPoint point = InjectionPointFactory.getPartialInjectionPoint(this.bean, parameter.getBaseType(),
                        parameter.getDeclaringCallable().getJavaMember(), parameter, bindingTypes);

                //Get observer parameter instance
                @SuppressWarnings("unchecked")
                Bean<Object> injectedBean = (Bean<Object>)InjectionResolver.getInstance().getInjectionPointBean(point);

                //Set for @Inject InjectionPoint
                if(WebBeansUtil.isDependent(injectedBean))
                {
                    if(!InjectionPoint.class.isAssignableFrom(ClassUtil.getClass(point.getType())))
                    {
                        InjectionPointBean.local.set(point);  
                    }
                }                   
               
View Full Code Here

Examples of javax.enterprise.inject.spi.InjectionPoint

    public Object doInjection()
    {
        try
        {
            InjectionPoint injectedField = getInjectedPoints(this.field).get(0);
           
            if (!field.isAccessible())
            {
                SecurityUtil.doPrivilegedSetAccessible(field, true);
            }
View Full Code Here

Examples of javax.enterprise.inject.spi.InjectionPoint

    protected void initDelegate()
    {
        Set<InjectionPoint> injectionPoints = getInjectionPoints();
        boolean found = false;
        InjectionPoint ipFound = null;
        for(InjectionPoint ip : injectionPoints)
        {
            if(ip.getAnnotated().isAnnotationPresent(Delegate.class))
            {
                if(!found)
                {
                    found = true;
                    ipFound = ip;                   
                }
                else
                {
                    throw new WebBeansConfigurationException("Decorators must have a one @Delegate injection point. " +
                            "But the decorator bean : " + toString() + " has more than one");
                }
            }           
        }
       
       
        if(ipFound == null)
        {
            throw new WebBeansConfigurationException("Decorators must have a one @Delegate injection point." +
                    "But the decorator bean : " + toString() + " has none");
        }
       
        String message = new String("Error in decorator : "+ toString() + ". The delegate injection point must be an injected field, " +
                "initializer method parameter or bean constructor method parameter. ");
       
        if(!(ipFound.getMember() instanceof Constructor))
        {
            AnnotatedElement element = (AnnotatedElement)ipFound.getMember();
            if(!element.isAnnotationPresent(Inject.class))
            {
                throw new WebBeansConfigurationException(message);
            }               
        }
View Full Code Here

Examples of javax.enterprise.inject.spi.InjectionPoint

        }
    }

    public static <T> void addFieldInjectionPointMetaData(AbstractOwbBean<T> owner, Field field)
    {
        InjectionPoint injectionPoint = InjectionPointFactory.getFieldInjectionPointData(owner, field);
        if (injectionPoint != null)
        {
            addImplicitComponentForInjectionPoint(injectionPoint);
            owner.addInjectionPoint(injectionPoint);
        }
View Full Code Here

Examples of javax.enterprise.inject.spi.InjectionPoint

    public static InjectionPoint getXMLInjectionPointData(Bean<?> owner, XMLInjectionPointModel xmlInjectionModel)
    {
        Asserts.assertNotNull(owner, "owner parameter can not be null");
        Asserts.assertNotNull(xmlInjectionModel, "xmlInjectionModel parameter can not be null");
       
        InjectionPoint injectionPoint = null;
       
        Set<Annotation> setAnns = xmlInjectionModel.getAnnotations();
        Annotation[] anns = new Annotation[setAnns.size()];
        anns = setAnns.toArray(anns);
       
View Full Code Here

Examples of javax.enterprise.inject.spi.InjectionPoint

       
        AnnotatedType<?> annotated = AnnotatedElementFactory.getInstance().newAnnotatedType(member.getDeclaringClass());
        AnnotatedMethod method = AnnotatedElementFactory.getInstance().newAnnotatedMethod(member, annotated);
        List<AnnotatedParameter<?>> parameters = method.getParameters();
       
        InjectionPoint point = null;
       
        for(AnnotatedParameter<?> parameter : parameters)
        {
            //@Observes is not injection point type for method parameters
            if(parameter.getAnnotation(Observes.class) == null)
View Full Code Here

Examples of javax.enterprise.inject.spi.InjectionPoint

        List<InjectionPoint> lists = new ArrayList<InjectionPoint>();

        List<AnnotatedParameter<X>> parameters = method.getParameters();
       
        InjectionPoint point = null;
       
        for(AnnotatedParameter<?> parameter : parameters)
        {
            //@Observes is not injection point type for method parameters
            if(parameter.getAnnotation(Observes.class) == null)
View Full Code Here

Examples of javax.inject.manager.InjectionPoint

        }
    }
   
    public static <T> void addFieldInjectionPointMetaData(AbstractComponent<T> owner, Field field)
    {
        InjectionPoint injectionPoint = InjectionPointFactory.getFieldInjectionPointData(owner, field);
        if(injectionPoint != null)
        {
            owner.addInjectionPoint(injectionPoint);  
        }
    }
View Full Code Here

Examples of javax.inject.manager.InjectionPoint

     * @return the injection point of the dependent owner
     */
    protected Object injectDependentOwnerInjectionPoint()
    {
        AbstractComponent<?> dependentComponent = this.injectionOwnerComponent;
        InjectionPoint injectionPointOfOwner = dependentComponent.getDependentOwnerInjectionPoint();
       
        if(injectionPointOfOwner != null)
        {
            return injectionPointOfOwner;
        }
View Full Code Here

Examples of javax.inject.manager.InjectionPoint

    public static InjectionPoint getXMLInjectionPointData(Bean<?> owner, XMLInjectionPointModel xmlInjectionModel)
    {
        Asserts.assertNotNull(owner, "owner parameter can not be null");
        Asserts.assertNotNull(xmlInjectionModel, "xmlInjectionModel parameter can not be null");
       
        InjectionPoint injectionPoint = null;
       
        Set<Annotation> setAnns = xmlInjectionModel.getAnnotations();
        Annotation[] anns = new Annotation[setAnns.size()];
        anns = setAnns.toArray(anns);
       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.