Package java.lang.annotation

Examples of java.lang.annotation.Documented


  public void doit() throws Exception {
    Class<?> clazz = Documented.class;
    System.out.println(clazz.getName());
    Method m = clazz.getMethod("annotationType");
    Documented d = Foo2.class.getAnnotation(Documented.class);
    System.out.println(m);
    System.out.println(d);
    System.out.println(m.getDeclaringClass().getName());
  }
View Full Code Here


  public static void main(String[] args) {
    new Play2().doit();
  }

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

        for (final String type : types) {
            Class<?> clazz = Class.forName(type);
            Retention retention = clazz.getAnnotation(Retention.class);
            assertNotNull(retention);

            Documented documented = clazz.getAnnotation(Documented.class);
            assertNotNull(documented);
            assertEquals(RetentionPolicy.SOURCE, retention.value());
            assertTrue(clazz.isAnnotation());
            assertTrue(clazz.isInterface());
            assertEquals(expectedPkg, clazz.getPackage());
View Full Code Here

TOP

Related Classes of java.lang.annotation.Documented

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.