use of java.lang.annotation.Documented in project spring-loaded by spring-projects.
the class Play method doit.
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());
}
use of java.lang.annotation.Documented in project auto by google.
the class MoreElementsTest method getAnnotationMirror.
@Test
public void getAnnotationMirror() {
TypeElement element = compilation.getElements().getTypeElement(AnnotatedAnnotation.class.getCanonicalName());
Optional<AnnotationMirror> documented = MoreElements.getAnnotationMirror(element, Documented.class);
Optional<AnnotationMirror> innerAnnotation = MoreElements.getAnnotationMirror(element, InnerAnnotation.class);
Optional<AnnotationMirror> suppressWarnings = MoreElements.getAnnotationMirror(element, SuppressWarnings.class);
expect.that(documented).isPresent();
expect.that(innerAnnotation).isPresent();
expect.that(suppressWarnings).isAbsent();
Element annotationElement = documented.get().getAnnotationType().asElement();
expect.that(MoreElements.isType(annotationElement)).isTrue();
expect.that(MoreElements.asType(annotationElement).getQualifiedName().toString()).isEqualTo(Documented.class.getCanonicalName());
annotationElement = innerAnnotation.get().getAnnotationType().asElement();
expect.that(MoreElements.isType(annotationElement)).isTrue();
expect.that(MoreElements.asType(annotationElement).getQualifiedName().toString()).isEqualTo(InnerAnnotation.class.getCanonicalName());
}
use of java.lang.annotation.Documented in project spring-loaded by spring-projects.
the class Play2 method doit.
public void doit() {
Documented d = Foo.class.getAnnotation(Documented.class);
System.out.println(d.annotationType());
}
Aggregations