Package javax.enterprise.inject.spi

Examples of javax.enterprise.inject.spi.InjectionPoint


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

        List<AnnotatedParameter<T>> parameters = constructor.getParameters();
       
        InjectionPoint point = null;
       
        for(AnnotatedParameter<?> parameter : parameters)
        {
            point = getGenericInjectionPoint(owner, parameter.getAnnotations().toArray(new Annotation[parameter.getAnnotations().size()]),
                                             parameter.getBaseType(), constructor.getJavaMember() , parameter);
View Full Code Here


        AnnotatedType<Object> annotated = (AnnotatedType<Object>)AnnotatedElementFactory.newAnnotatedType(member.getDeclaringClass());
        AnnotatedConstructor constructor = AnnotatedElementFactory.newAnnotatedConstructor((Constructor<Object>)member,annotated);
        List<AnnotatedParameter<?>> parameters = constructor.getParameters();
       
        InjectionPoint point = null;
       
        for(AnnotatedParameter<?> parameter : parameters)
        {
            point = getGenericInjectionPoint(owner, parameter.getAnnotations().toArray(new Annotation[parameter.getAnnotations().size()]),
                                             parameter.getBaseType(), member , parameter);
View Full Code Here

        }
    }

    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

    public void testFieldWithNamedValue() throws Exception
    {
        Bean<NamedFieldWithNamedValue> bean = defineManagedBean(NamedFieldWithNamedValue.class);
        Field field = NamedFieldWithNamedValue.class.getDeclaredField("paymentProcessor");
       
        InjectionPoint point =InjectionPointFactory.getFieldInjectionPointData(bean, field);
       
        WebBeansUtil.checkInjectionPointNamedQualifier(point);
       
        String value = qulifier(point);
       
View Full Code Here

    public void testFieldWithoutNamedValue() throws Exception
    {
        Bean<NamedFieldWithoutNamedValue> bean = defineManagedBean(NamedFieldWithoutNamedValue.class);
        Field field = NamedFieldWithoutNamedValue.class.getDeclaredField("paymentProcessor");
       
        InjectionPoint point =InjectionPointFactory.getFieldInjectionPointData(bean, field);
       
        WebBeansUtil.checkInjectionPointNamedQualifier(point);
       
        String value = qulifier(point);
       
View Full Code Here

    public void testOtherWithNamedValue() throws Exception
    {
        Bean<NamedOtherWithNamedValue> bean = defineManagedBean(NamedOtherWithNamedValue.class);
        Constructor<?> constructor = NamedOtherWithNamedValue.class.getDeclaredConstructor(new Class<?>[]{IPayment.class});
       
        InjectionPoint point =InjectionPointFactory.getConstructorInjectionPointData(bean, constructor).get(0);
       
        WebBeansUtil.checkInjectionPointNamedQualifier(point);
       
        String value = qulifier(point);
       
View Full Code Here

    public void testOtherWithoutNamedValue() throws Exception
    {
        Bean<NamedOtherWithoutNamedValue> bean = defineManagedBean(NamedOtherWithoutNamedValue.class);
        Constructor<?> constructor = NamedOtherWithoutNamedValue.class.getDeclaredConstructor(new Class<?>[]{IPayment.class});
       
        InjectionPoint point =InjectionPointFactory.getConstructorInjectionPointData(bean, constructor).get(0);
               
        String value = qulifier(point);
       
        Assert.assertEquals("", value);
       
View Full Code Here

        Bean<InjectionPointMetaDataOwner> bean2 = (Bean<InjectionPointMetaDataOwner>)getBeanManager().getBeans(InjectionPointMetaDataOwner.class.getName()).iterator().next();
       
        CreationalContext<InjectionPointMetaDataOwner> cc2 = getBeanManager().createCreationalContext(bean2);
        InjectionPointMetaDataOwner model2 = (InjectionPointMetaDataOwner) getBeanManager().getReference(bean2, InjectionPointMetaDataOwner.class, cc2);
       
        InjectionPoint point = model2.getInjectionPoint();
        Assert.assertTrue(point.getBean().equals(bean));
        Assert.assertTrue(point.getMember() instanceof Field);
       
        shutDownContainer();

    }
View Full Code Here

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

    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

Related Classes of javax.enterprise.inject.spi.InjectionPoint

Copyright © 2018 www.massapicom. 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.