Package org.jboss.metadata.annotation.creator

Examples of org.jboss.metadata.annotation.creator.AnnotationContext


            log.trace("Cannot scan classes, missing AnnotationRepository as attachment: " + unit.getName());
         return Collections.emptySet();
      }

      String creatorInfo = creator.toString();
      AnnotationContext context = creator.getAnnotationContext();
      Set<Class<?>> classes = new HashSet<Class<?>>();

      Collection<Class<? extends Annotation>> typeAnnotations = context.getTypeAnnotations();
      if (trace)
         log.trace("Creator: " + creatorInfo + ", type annotations: " + typeAnnotations);
      for(Class<? extends Annotation> annotation : typeAnnotations)
      {
         Class<Annotation> annotationClass = (Class<Annotation>)annotation;
         Set<Element<Annotation, Class<?>>> elements = env.classIsAnnotatedWith(annotationClass);
         for(Element<Annotation, Class<?>> elt : elements)
               classes.add(elt.getOwner());
      }

      Collection<Class<? extends Annotation>> methodAnnotations = context.getMethodAnnotations();
      if (trace)
         log.trace("Creator: " + creatorInfo + ", method annotations: " + methodAnnotations);
      for(Class<? extends Annotation> annotation : methodAnnotations)
      {
         Class<Annotation> annotationClass = (Class<Annotation>)annotation;
         Set<Element<Annotation, Method>> elements = env.classHasMethodAnnotatedWith(annotationClass);
         for(Element<Annotation, Method> elt : elements)
            classes.add(elt.getOwner());
      }

      Collection<Class<? extends Annotation>> fieldAnnotations = context.getFieldAnnotations();
      if (trace)
         log.trace("Creator: " + creatorInfo + ", field annotations: " + fieldAnnotations);
      for(Class<? extends Annotation> annotation : fieldAnnotations)
      {
         Class<Annotation> annotationClass = (Class<Annotation>)annotation;
View Full Code Here


      }
      AnnotationFinder<AnnotatedElement> finder = new DefaultAnnotationFinder<AnnotatedElement>();
      Web30MetaDataCreator creator = new Web30MetaDataCreator(finder);
      // Merge processed annotations from all scopes
      Set<Class<? extends Annotation>> annotations = new HashSet<Class<? extends Annotation>>();
      AnnotationContext annotationContext = creator.getAnnotationContext();
      if (annotationContext.getTypeAnnotations() != null)
         annotations.addAll(annotationContext.getTypeAnnotations());
      if (annotationContext.getMethodAnnotations() != null)
         annotations.addAll(annotationContext.getMethodAnnotations());
      if (annotationContext.getFieldAnnotations() != null)
         annotations.addAll(annotationContext.getFieldAnnotations());

      boolean metaData = false;
      for (VirtualFile path : classpath)
      {
         Set<Class<?>> annotatedClasses = new HashSet<Class<?>>();
View Full Code Here

      }
      AnnotationFinder<AnnotatedElement> finder = new DefaultAnnotationFinder<AnnotatedElement>();
      Web30MetaDataCreator creator = new Web30MetaDataCreator(finder);
      // Merge processed annotations from all scopes
      Set<Class<? extends Annotation>> annotations = new HashSet<Class<? extends Annotation>>();
      AnnotationContext annotationContext = creator.getAnnotationContext();
      if (annotationContext.getTypeAnnotations() != null)
         annotations.addAll(annotationContext.getTypeAnnotations());
      if (annotationContext.getMethodAnnotations() != null)
         annotations.addAll(annotationContext.getMethodAnnotations());
      if (annotationContext.getFieldAnnotations() != null)
         annotations.addAll(annotationContext.getFieldAnnotations());

      Collection<Class<?>> specEligibleResourceInjectionClasses = this.getResourceInjectionEligibleWebAppClasses(resourceIndex, classpath);
      if (specEligibleResourceInjectionClasses.isEmpty())
      {
         return;
View Full Code Here

    * @return the AnnotationContext
    */
   @Override
   public AnnotationContext getAnnotationContext()
   {
      return new AnnotationContext()
      {
         public Collection<Class<? extends Annotation>> getTypeAnnotations()
         {
            return getAnnotationsForScope(Scope.TYPE);
         }
View Full Code Here

    * @return the AnnotationContext
    */
   @Override
   public AnnotationContext getAnnotationContext()
   {
      return new AnnotationContext()
      {
         public Collection<Class<? extends Annotation>> getTypeAnnotations()
         {
            return getAnnotationsForScope(Scope.TYPE);
         }
View Full Code Here

    * @return the AnnotationContext
    */
   @Override
   public AnnotationContext getAnnotationContext()
   {
      return new AnnotationContext()
      {
         public Collection<Class<? extends Annotation>> getTypeAnnotations()
         {
            return getAnnotationsForScope(Scope.TYPE);
         }
View Full Code Here

         return Collections.emptySet();
      }

      String creatorInfo = creator.toString();
      AnnotationContext context = creator.getAnnotationContext();     
      Set<Class<?>> classes = new HashSet<Class<?>>();

      Collection<Class<? extends Annotation>> typeAnnotations = context.getTypeAnnotations();
      if (trace)
         log.trace("Creator: " + creatorInfo + ", type annotations: " + typeAnnotations);
      for(Class<? extends Annotation> annotation : typeAnnotations)
      {
         Class<Annotation> annotationClass = (Class<Annotation>)annotation;
         Set<Element<Annotation, Class<?>>> elements = env.classIsAnnotatedWith(annotationClass);
         for(Element<Annotation, Class<?>> elt : elements)
               classes.add(elt.getOwner());
      }

      Collection<Class<? extends Annotation>> methodAnnotations = context.getMethodAnnotations();
      if (trace)
         log.trace("Creator: " + creatorInfo + ", method annotations: " + methodAnnotations);
      for(Class<? extends Annotation> annotation : methodAnnotations)
      {
         Class<Annotation> annotationClass = (Class<Annotation>)annotation;
         Set<Element<Annotation, Method>> elements = env.classHasMethodAnnotatedWith(annotationClass);
         for(Element<Annotation, Method> elt : elements)
            classes.add(elt.getOwner());
      }

      Collection<Class<? extends Annotation>> fieldAnnotations = context.getFieldAnnotations();
      if (trace)
         log.trace("Creator: " + creatorInfo + ", field annotations: " + fieldAnnotations);
      for(Class<? extends Annotation> annotation : fieldAnnotations)
      {
         Class<Annotation> annotationClass = (Class<Annotation>)annotation;
View Full Code Here

TOP

Related Classes of org.jboss.metadata.annotation.creator.AnnotationContext

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.