Package org.jboss.solder.reflection

Examples of org.jboss.solder.reflection.AnnotationInstanceProvider


            }
        }
        if (daoClass.isAnnotationPresent(WithEntityManager.class)) {
            Class<? extends Annotation>[] annotations = daoClass.getAnnotation(WithEntityManager.class).value();
            qualifiers = new Annotation[annotations.length];
            AnnotationInstanceProvider provider = new AnnotationInstanceProvider();
            for (int i = 0; i < annotations.length; i++) {
                Class<? extends Annotation> clazz = annotations[i];
                qualifiers[i] = provider.get(clazz, new HashMap<String, Object>());
            }
        } else {
            qualifiers = new Annotation[] {};
        }
    }
View Full Code Here


    }

    private AnnotatedType<Object> decorateType(final AnnotatedType<Object> type, final Class<? extends Annotation> jsfScope) {
        final Class<? extends Annotation> cdiScope = getCdiScopeFor(jsfScope);

        AnnotationInstanceProvider provider = new AnnotationInstanceProvider();
        final Annotation cdiScopeAnnotation = provider.get(cdiScope, Collections.EMPTY_MAP);

        AnnotatedTypeBuilder builder;
        builder = new AnnotatedTypeBuilder()
                .readFromType(type)
                .removeFromClass(jsfScope)
View Full Code Here

                    propertyName(entity, property), e);
        }
    }

    private Object resolvePrincipal(Object entity, Property<Object> property) {
        AnnotationInstanceProvider provider = new AnnotationInstanceProvider();
        CurrentUser principal = provider.get(CurrentUser.class, Collections.<String, Object>emptyMap());
        Class<?> propertyClass = property.getJavaClass();
        Set<Bean<?>> beans = manager.getBeans(propertyClass, principal);
        if (!beans.isEmpty() && beans.size() == 1) {
            Bean<?> bean = beans.iterator().next();
            Object result = manager.getReference(bean, propertyClass, manager.createCreationalContext(bean));
View Full Code Here

                    propertyName(entity, property), e);
        }
    }

    private Object resolvePrincipal(Object entity, Property<Object> property) {
        AnnotationInstanceProvider provider = new AnnotationInstanceProvider();
        CurrentUser principal = provider.get(CurrentUser.class, Collections.<String, Object>emptyMap());
        Class<?> propertyClass = property.getJavaClass();
        Set<Bean<?>> beans = manager.getBeans(propertyClass, principal);
        if (!beans.isEmpty() && beans.size() == 1) {
            Bean<?> bean = beans.iterator().next();
            Object result = manager.getReference(bean, propertyClass,
View Full Code Here

            }
        }
        if (daoClass.isAnnotationPresent(WithEntityManager.class)) {
            Class<? extends Annotation>[] annotations = daoClass.getAnnotation(WithEntityManager.class).value();
            qualifiers = new Annotation[annotations.length];
            AnnotationInstanceProvider provider = new AnnotationInstanceProvider();
            for (int i = 0; i < annotations.length; i++) {
                Class<? extends Annotation> clazz = annotations[i];
                qualifiers[i] = provider.get(clazz, new HashMap<String, Object>());
            }
        } else {
            qualifiers = new Annotation[] {};
        }
    }
View Full Code Here

TOP

Related Classes of org.jboss.solder.reflection.AnnotationInstanceProvider

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.