Package org.checkerframework.javacutil
Class BasicAnnotationProvider
java.lang.Object
org.checkerframework.javacutil.BasicAnnotationProvider
- All Implemented Interfaces:
- AnnotationProvider
An AnnotationProvider that is independent of any type hierarchy.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiongetAnnotationMirror(Tree tree, Class<? extends Annotation> target) Return the annotation ontreethat is in the hierarchy that contains the qualifiertarget.getDeclAnnotation(Element elt, Class<? extends Annotation> anno) Returns the AnnotationMirror, of the given class, used to annotate the element.booleanisSideEffectFree(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.
- 
Constructor Details- 
BasicAnnotationProviderpublic BasicAnnotationProvider()
 
- 
- 
Method Details- 
getDeclAnnotationReturns the AnnotationMirror, of the given class, used to annotate the element. Returns null if no such annotation exists.- Specified by:
- getDeclAnnotationin interface- AnnotationProvider
- Parameters:
- elt- the element
- anno- annotation class
- Returns:
- an annotation mirror of class annoonelt, or an equivalent one, or null if none exists onanno
 
- 
getAnnotationMirrorpublic @Nullable AnnotationMirror getAnnotationMirror(Tree tree, Class<? extends Annotation> target) Return the annotation ontreethat is in the hierarchy that contains the qualifiertarget. Returns null if none exists.This implementation always returns null, because it has no access to any type hierarchy. - Specified by:
- getAnnotationMirrorin interface- AnnotationProvider
- Parameters:
- tree- the tree of which the annotation is returned
- target- the class of the annotation
- Returns:
- the annotation on treethat has the classtarget, or null
 
- 
isSideEffectFreeReturns 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.Note that this method takes account of this AnnotationProvider's semantics, whereas org.checkerframework.dataflow.util.PurityUtils#isSideEffectFreedoes not.This implementation returns true if the @SideEffectFreeannotation is present on the given method.- Specified by:
- isSideEffectFreein interface- AnnotationProvider
- Parameters:
- methodElement- a method
- Returns:
- true if a call to the method does not undo flow-sensitive type refinement
 
 
-