Package org.jboss.metadata.annotation.creator.web

Examples of org.jboss.metadata.annotation.creator.web.Web30MetaDataCreator


    * @param classes the candidate classes
    */
   protected void processJBossWebMetaData(VFSDeploymentUnit unit,
         AnnotationFinder<AnnotatedElement> finder, Map<VirtualFile, Collection<Class<?>>> classes)
   {
      Web30MetaDataCreator creator = new Web30MetaDataCreator(finder);
      boolean metaData = false;
      for (VirtualFile path : classes.keySet())
      {
         WebMetaData annotationMetaData = creator.create(classes.get(path));
         log.debug("Add annotations: " + WEB_ANNOTATED_ATTACHMENT_NAME + ":" + path.getName());
         if (annotationMetaData != null)
         {
            unit.addAttachment(WEB_ANNOTATED_ATTACHMENT_NAME + ":" + path.getName(), annotationMetaData, WebMetaData.class);
            metaData = true;
View Full Code Here


      if (ri == null)
      {
         return;
      }
      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<?>>();
         for (Class<? extends Annotation> annotation : annotations)
         {
            annotatedClasses.addAll(ri.getAnnotatedClasses(path, annotation));
         }
         WebMetaData annotationMetaData = creator.create(annotatedClasses);
         if (annotationMetaData != null)
         {
            unit.addAttachment(WEB_ANNOTATED_ATTACHMENT_NAME + ":" + path.getName(), annotationMetaData, WebMetaData.class);
            metaData = true;
         }
View Full Code Here

      if (resourceIndex == null)
      {
         return;
      }
      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;
      }
      boolean metaData = false;
      for (VirtualFile path : classpath)
      {
         Collection<Class<?>> eligibleAnnotatedClasses = new HashSet<Class<?>>();
         for (Class<? extends Annotation> annotation : annotations)
         {
            Collection<Class<?>> annotatedClasses = resourceIndex.getAnnotatedClasses(path, annotation);
            eligibleAnnotatedClasses.addAll(this.retainResourceInjectionEligibleWebAppClasses(specEligibleResourceInjectionClasses, annotatedClasses));
         }
         WebMetaData annotationMetaData = creator.create(eligibleAnnotatedClasses);
         if (annotationMetaData != null)
         {
            unit.addAttachment(WEB_ANNOTATED_ATTACHMENT_NAME + ":" + path.getName(), annotationMetaData,
                  WebMetaData.class);
            metaData = true;
View Full Code Here

TOP

Related Classes of org.jboss.metadata.annotation.creator.web.Web30MetaDataCreator

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.