Examples of AnnotatedType


Examples of com.buschmais.cdo.spi.reflection.AnnotatedType

            }
        }
        // remove all super types if their sub types are already contained in the type set
        TypeMetadataSet<EntityTypeMetadata<EntityMetadata>> uniqueTypes = new TypeMetadataSet();
        for (EntityTypeMetadata<EntityMetadata> entityTypeMetadata : allEntityTypeMetadatas) {
            AnnotatedType annotatedType = entityTypeMetadata.getAnnotatedType();
            boolean subtype = false;
            for (Iterator<EntityTypeMetadata<EntityMetadata>> subTypeIterator = allEntityTypeMetadatas.iterator(); subTypeIterator.hasNext() && !subtype; ) {
                AnnotatedType otherAnnotatedType = subTypeIterator.next().getAnnotatedType();
                if (!annotatedType.equals(otherAnnotatedType) && annotatedType.getAnnotatedElement().isAssignableFrom(otherAnnotatedType.getAnnotatedElement())) {
                    subtype = true;
                }
            }
            if (!subtype) {
                uniqueTypes.add(entityTypeMetadata);
View Full Code Here

Examples of com.buschmais.xo.spi.reflection.AnnotatedType

    QueryResultIterableImpl(SessionContext<?, Entity, ?, ?, ?, Relation, ?, ?> sessionContext,
                            ResultIterator<Map<String, Object>> iterator, Class<?> returnType, SortedSet<Class<?>> returnTypes) {
        this.sessionContext = sessionContext;
        this.iterator = iterator;
        this.returnTypes = returnTypes;
        if (CompositeRowObject.class.equals(returnType) || new AnnotatedType(returnType).getByMetaAnnotation(QueryDefinition.class) != null) {
            this.rowProxyMethodService = new RowProxyMethodService(returnTypes);
        } else {
            this.rowProxyMethodService = null;
        }
    }
View Full Code Here

Examples of javax.enterprise.inject.spi.AnnotatedType

    /**
     * Lets perform injection of all beans which use Camel annotations
     */
    public void onInjectionTarget(@Observes ProcessInjectionTarget<?> event) {
        final InjectionTarget injectionTarget = event.getInjectionTarget();
        AnnotatedType annotatedType = event.getAnnotatedType();
        final Class<Object> beanClass = annotatedType.getJavaClass();
        // TODO this is a bit of a hack - what should the bean name be?
        final String beanName = injectionTarget.toString();
        ContextName contextName = annotatedType.getAnnotation(ContextName.class);
        final BeanAdapter adapter = createBeanAdapter(beanClass, contextName);
        if (!adapter.isEmpty()) {
            DelegateInjectionTarget newTarget = new DelegateInjectionTarget(injectionTarget) {

                @Override
View Full Code Here

Examples of javax.enterprise.inject.spi.AnnotatedType

        BeanManager beanManager = getBeanManager();

        CreationalContext creationalContext = beanManager.createCreationalContext(null);

        AnnotatedType annotatedType = beanManager.createAnnotatedType(instance.getClass());
        InjectionTarget injectionTarget = beanManager.createInjectionTarget(annotatedType);
        injectionTarget.inject(instance, creationalContext);
        return instance;
    }
View Full Code Here

Examples of javax.enterprise.inject.spi.AnnotatedType

                !(processBean.getAnnotated() instanceof AnnotatedType))
        {
            return;
        }

        AnnotatedType annotatedType = (AnnotatedType)processBean.getAnnotated();

        if (annotatedType.getJavaClass().isAnnotationPresent(ExceptionHandler.class))
        {
            final Set<AnnotatedMethod<? super T>> methods = annotatedType.getMethods();

            for (AnnotatedMethod<? super T> method : methods)
            {
                if (HandlerMethodImpl.isHandler(method))
                {
View Full Code Here

Examples of javax.enterprise.inject.spi.AnnotatedType

    private <T> T tryToInjectFields(T instance)
    {
        CreationalContext creationalContext = beanManager.createCreationalContext(null);

        AnnotatedType annotatedType = beanManager.createAnnotatedType(instance.getClass());
        InjectionTarget injectionTarget = beanManager.createInjectionTarget(annotatedType);
        injectionTarget.inject(instance, creationalContext);
        return instance;
    }
View Full Code Here

Examples of javax.enterprise.inject.spi.AnnotatedType

    public <T> T injectFields(T instance)
    {
        BeanManager beanManager = getBeanManager();
        CreationalContext creationalContext = beanManager.createCreationalContext(null);

        AnnotatedType annotatedType = beanManager.createAnnotatedType(instance.getClass());
        InjectionTarget injectionTarget = beanManager.createInjectionTarget(annotatedType);
        injectionTarget.inject(instance, creationalContext);
        return instance;
    }
View Full Code Here

Examples of javax.enterprise.inject.spi.AnnotatedType

  @SuppressWarnings("unchecked")
  public ErraiServiceBean(BeanManager bm, String name) {

    //use this to read annotations of the class
    AnnotatedType at = bm.createAnnotatedType(ErraiServiceImpl.class);

    //use this to create the class and inject dependencies
    this.it = bm.createInjectionTarget(at);
    this.name = name;
  }
View Full Code Here

Examples of javax.enterprise.inject.spi.AnnotatedType

  static final Set<Type> types = unmodifiableSet(new HashSet<Type>(asList(RequestDispatcher.class, Object.class)));

  public RequestDispatcherMetaData(final BeanManager bm, final RequestDispatcher delegate) {

    //use this to read annotations of the class
    final AnnotatedType at = bm.createAnnotatedType(delegate.getClass());

    //use this to create the class and inject dependencies
    this.it = bm.createInjectionTarget(at);

    // invocation target
View Full Code Here

Examples of javax.enterprise.inject.spi.AnnotatedType

  final Conversation delegate;

  public ConversationMetaData(BeanManager bm, Conversation delegate) {

    //use this to read annotations of the class
    AnnotatedType at = bm.createAnnotatedType(ErraiConversation.class);

    //use this to create the class and inject dependencies
    this.it = bm.createInjectionTarget(at);

    // invocation target
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.