Package org.jboss.deployers.spi.annotations

Examples of org.jboss.deployers.spi.annotations.AnnotationEnvironment.classIsAnnotatedWith()


      Set<Class<?>> classes = new HashSet<Class<?>>();
      for(Class<? extends Annotation> annotation : annotationOnClass)
      {
         Class<Annotation> annotationClass = (Class<Annotation>)annotation;
         Set<Element<Annotation, Class<?>>> elements = env.classIsAnnotatedWith(annotationClass);
         for(Element<Annotation, Class<?>> elt : elements)
            classes.add(elt.getOwner());
      }
      for(Class<? extends Annotation> annotation : annotationOnMethod)
      {
View Full Code Here


      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();
View Full Code Here

      assertEar(unit);
      try
      {
         AnnotationEnvironment env = unit.getAttachment(AnnotationEnvironment.class);
         assertNotNull(env);
         Set<Element<Annotation, Class<?>>> annotations = env.classIsAnnotatedWith("org.jboss.test.deployers.vfs.annotations.support.MarkedAnnotation");
         assertNotNull(annotations);
         assertEquals(1, annotations.size());

         DeploymentUnit jarUnit = assertChild(unit, "simple.jar");
         assertJar(jarUnit);
View Full Code Here

   protected void assertAnnotations(DeploymentUnit unit, int onClass, int onMethod, int onFiled)
   {
      AnnotationEnvironment env = unit.getAttachment(AnnotationEnvironment.class);
      assertNotNull(env);

      Set classes = env.classIsAnnotatedWith("org.jboss.test.deployers.vfs.annotations.support.Marked");
      assertNotNull(classes);
      assertEquals(onClass, classes.size());

      Set methods = env.classHasMethodAnnotatedWith("org.jboss.test.deployers.vfs.annotations.support.Marked");
      assertNotNull(methods);
View Full Code Here

         assertNotLoaded(unit, "org.jboss.test.deployers.annotations.support.AnnotationsHolder");
         // annotations are loaded, OK?
         assertLoaded(unit, "org.jboss.test.deployers.annotations.support.TestAnnotation");

         AnnotationEnvironment env = getAnnotationEnvironment(unit);
         Set<Element<TestAnnotation, Class<?>>> classes = env.classIsAnnotatedWith(taClass);
         assertNotNull(classes);
         assertEquals(1, classes.size());
         assertEquals(AnnotationsHolder.class.getName(), classes.iterator().next().getOwnerClassName());
         assertNotLoaded(unit, "org.jboss.test.deployers.annotations.support.AnnotationsHolder");
View Full Code Here

         assertNotNull(classes);
         assertEquals(1, classes.size());
         assertEquals(AnnotationsHolder.class.getName(), classes.iterator().next().getOwnerClassName());
         assertNotLoaded(unit, "org.jboss.test.deployers.annotations.support.AnnotationsHolder");

         Element<TestAnnotation, Class<?>> ecl = getSingleton(env.classIsAnnotatedWith(taClass));
         Annotation tacl = ecl.getAnnotation();
         assertNotNull(tacl);
         assertEquals("class", getValue(tacl));

         Element<TestAnnotation, Constructor<?>> ec = getSingleton(env.classHasConstructorAnnotatedWith(taClass));
View Full Code Here

         assertNotLoaded(unit, "org.jboss.test.deployers.annotations.support.AnnotationsHolder");
         // annotations are loaded, OK?
         assertLoaded(unit, "org.jboss.test.deployers.annotations.support.TestAnnotation");

         AnnotationEnvironment env = getAnnotationEnvironment(unit);
         Set<Element<Annotation, Class<?>>> classes = env.classIsAnnotatedWith(annotationName);
         assertNotNull(classes);
         assertEquals(1, classes.size());
         assertEquals(AnnotationsHolder.class.getName(), classes.iterator().next().getOwnerClassName());
         assertNotLoaded(unit, "org.jboss.test.deployers.annotations.support.AnnotationsHolder");
View Full Code Here

         assertNotNull(classes);
         assertEquals(1, classes.size());
         assertEquals(AnnotationsHolder.class.getName(), classes.iterator().next().getOwnerClassName());
         assertNotLoaded(unit, "org.jboss.test.deployers.annotations.support.AnnotationsHolder");

         Element<Annotation, Class<?>> ecl = getSingleton(env.classIsAnnotatedWith(annotationName));
         Annotation tacl = ecl.getAnnotation();
         assertNotNull(tacl);
         assertEquals("class", getValue(tacl));

         Element<Annotation, Constructor<?>> ec = getSingleton(env.classHasConstructorAnnotatedWith(annotationName));
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.