public class BasicAnnotationProvider extends Object implements AnnotationProvider
Constructor and Description |
---|
BasicAnnotationProvider() |
Modifier and Type | Method and Description |
---|---|
@Nullable AnnotationMirror |
getAnnotationMirror(Tree tree,
Class<? extends Annotation> target)
Return the annotation on
tree that is in the hierarchy that contains the qualifier
target . |
@Nullable AnnotationMirror |
getDeclAnnotation(Element elt,
Class<? extends Annotation> anno)
Returns the AnnotationMirror, of the given class, used to annotate the element.
|
boolean |
isSideEffectFree(ExecutableElement methodElement)
Returns true if the given method is side-effect-free according to this AnnotationProvider
— that is, if a call to the given method does not undo flow-sensitive type refinement.
|
public @Nullable AnnotationMirror getDeclAnnotation(Element elt, Class<? extends Annotation> anno)
getDeclAnnotation
in interface AnnotationProvider
elt
- the elementanno
- annotation classanno
on elt
, or an equivalent one, or
null if none exists on anno
public @Nullable AnnotationMirror getAnnotationMirror(Tree tree, Class<? extends Annotation> target)
tree
that is in the hierarchy that contains the qualifier
target
. Returns null if none exists.
This implementation always returns null, because it has no access to any type hierarchy.
getAnnotationMirror
in interface AnnotationProvider
tree
- the tree of which the annotation is returnedtarget
- the class of the annotationtree
that has the class target
, or nullpublic boolean isSideEffectFree(ExecutableElement methodElement)
Note that this method takes account of this AnnotationProvider's semantics, whereas org.checkerframework.dataflow.util.PurityUtils#isSideEffectFree
does not.
This implementation returns true if the @SideEffectFree
annotation is present on the
given method.
isSideEffectFree
in interface AnnotationProvider
methodElement
- a method