blob: 6cf40e79cfa9c0522cf981dee14ae9813b88168c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
package org.checkerframework.javacutil;
import com.sun.source.tree.Tree;
import java.lang.annotation.Annotation;
import java.util.List;
import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.Element;
public class BasicAnnotationProvider implements AnnotationProvider {
@Override
public AnnotationMirror getDeclAnnotation(Element elt, Class<? extends Annotation> anno) {
List<? extends AnnotationMirror> annotationMirrors = elt.getAnnotationMirrors();
// Then look at the real annotations.
for (AnnotationMirror am : annotationMirrors) {
if (AnnotationUtils.areSameByClass(am, anno)) {
return am;
}
}
return null;
}
@Override
public AnnotationMirror getAnnotationMirror(Tree tree, Class<? extends Annotation> target) {
return null;
}
}
|