Examples of annotationType()


Examples of java.lang.annotation.Annotation.annotationType()

  
   public void testSimple() throws Exception
   {
      String expr = "@org.jboss.test.annotation.factory.support.Simple";
      Annotation annotation = (Annotation)AnnotationCreator.createAnnotation(expr, Simple.class);
      assertEquals(Simple.class, annotation.annotationType());
   }
  
   public void testSimpleValue() throws Exception
   {
      String expr = "@org.jboss.test.annotation.factory.support.SimpleValue(\"Test\")";
View Full Code Here

Examples of java.lang.annotation.Annotation.annotationType()

  
   public void testSimpleValue() throws Exception
   {
      String expr = "@org.jboss.test.annotation.factory.support.SimpleValue(\"Test\")";
      Annotation annotation  = (Annotation)AnnotationCreator.createAnnotation(expr, SimpleValue.class);
      assertEquals(SimpleValue.class, annotation.annotationType());
      assertEquals("Test", ((SimpleValue)annotation).value());
   }
  
   public void testSimpleValueWithPropertyReplacement() throws Exception
   {
View Full Code Here

Examples of java.lang.annotation.Annotation.annotationType()

   public void testSimpleValueWithPropertyReplacement() throws Exception
   {
      String expr = "@org.jboss.test.annotation.factory.support.SimpleValue(\"${value1}\")";
      System.setProperty("value1", "Test");
      Annotation annotation  = (Annotation)AnnotationCreator.createAnnotation(expr, SimpleValue.class, true);
      assertEquals(SimpleValue.class, annotation.annotationType());
      assertEquals("Test", ((SimpleValue)annotation).value());
   }
  
   public void testSimpleValueWithPropertyReplacementFromProperties() throws Exception
   {
View Full Code Here

Examples of java.lang.annotation.Annotation.annotationType()

   public void testSimpleValueWithPropertyReplacementFromProperties() throws Exception
   {
      String expr = "@org.jboss.test.annotation.factory.support.SimpleValue(\"${value1}\")";
      System.setProperty("value1", "Test");
      Annotation annotation  = (Annotation)AnnotationCreator.createAnnotation(expr, SimpleValue.class, System.getProperties());
      assertEquals(SimpleValue.class, annotation.annotationType());
      assertEquals("Test", ((SimpleValue)annotation).value());
   }

   public void testComplex() throws Exception
   {
View Full Code Here

Examples of java.lang.annotation.Annotation.annotationType()

   public void testComplex() throws Exception
   {
      String expr = "@org.jboss.test.annotation.factory.support.Complex(ch='a', string=\"Test123\", flt=9.9, dbl=123456789.99, shrt=1, lng=987654321, integer=123, bool=true, annotation=@org.jboss.test.annotation.factory.support.SimpleValue(\"Yes\"), array={\"Test\", \"123\"}, clazz=java.lang.Long.class, enumVal=org.jboss.test.annotation.factory.support.MyEnum.TWO, primitiveArray={1,2,3})";
      Annotation annotation  = (Annotation)AnnotationCreator.createAnnotation(expr, Complex.class);
      assertEquals(Complex.class, annotation.annotationType());
      Complex complex = (Complex)annotation;
      assertEquals('a', complex.ch());
      assertEquals("Test123", complex.string());
      assertEquals(9,9, complex.flt());
      assertEquals(123456789.99, complex.dbl());
View Full Code Here

Examples of java.lang.annotation.Annotation.annotationType()

      System.setProperty("clazz", "java.lang.Long.class");
      System.setProperty("enumVal", "org.jboss.test.annotation.factory.support.MyEnum.TWO");
      System.setProperty("primitiveArray", "{1, 2, 3}");
     
      Annotation annotation  = (Annotation)AnnotationCreator.createAnnotation(expr, Complex.class, true);
      assertEquals(Complex.class, annotation.annotationType());
      Complex complex = (Complex)annotation;
      assertEquals('a', complex.ch());
      assertEquals("Test123", complex.string());
      assertEquals(9,9, complex.flt());
      assertEquals(123456789.99, complex.dbl());
View Full Code Here

Examples of java.lang.annotation.Annotation.annotationType()

      if (annotations != null)
      {
         for (AnnotationItem item : annotations)
         {
            Annotation a = item.getAnnotation();
            if (annotationType.equals(a.annotationType()))
               return item;
         }
      }
     
      return null;
View Full Code Here

Examples of java.lang.annotation.Annotation.annotationType()

      for (AnnotationItem<? extends Annotation> item : items)
      {
         assertNotNull("Null annotation item " + Arrays.asList(items), item);
         Annotation annotation = item.getAnnotation();
         assertNotNull("Null annotation " + Arrays.asList(items), annotation);
         actual.add(annotation.annotationType());
      }
     
      assertExpectedAnnotations("Annotations", expected, actual);
   }
  
View Full Code Here

Examples of java.lang.annotation.Documented.annotationType()

    new Play2().doit();
  }

  public void doit() {
    Documented d = Foo.class.getAnnotation(Documented.class);
    System.out.println(d.annotationType());
  }
}
View Full Code Here

Examples of java.lang.annotation.IncompleteAnnotationException.annotationType()

        Class clazz = String.class;
        String elementName = "some element";
        IncompleteAnnotationException e = new IncompleteAnnotationException(
                clazz, elementName);
        assertNotNull("can not instanciate IncompleteAnnotationException", e);
        assertSame("wrong annotation type", clazz, e.annotationType());
        assertSame("wrong element name", elementName, e.elementName());
    }
}
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.