Package org.checkerframework.javacutil
Interface AnnotationProvider
- All Known Implementing Classes:
- AccumulationAnnotatedTypeFactory,- AliasingAnnotatedTypeFactory,- AnnotatedTypeFactory,- BaseAnnotatedTypeFactory,- BaseAnnotatedTypeFactoryForIndexChecker,- BasicAnnotationProvider,- CalledMethodsAnnotatedTypeFactory,- ClassValAnnotatedTypeFactory,- CompilerMessagesAnnotatedTypeFactory,- FenumAnnotatedTypeFactory,- FormatterAnnotatedTypeFactory,- GenericAnnotatedTypeFactory,- GuiEffectTypeFactory,- I18nAnnotatedTypeFactory,- I18nFormatterAnnotatedTypeFactory,- InitializationAnnotatedTypeFactory,- InitializedFieldsAnnotatedTypeFactory,- InterningAnnotatedTypeFactory,- KeyForAnnotatedTypeFactory,- LessThanAnnotatedTypeFactory,- LocalizableKeyAnnotatedTypeFactory,- LockAnnotatedTypeFactory,- LowerBoundAnnotatedTypeFactory,- MethodValAnnotatedTypeFactory,- MustCallAnnotatedTypeFactory,- NonEmptyAnnotatedTypeFactory,- NullnessAnnotatedTypeFactory,- OptionalAnnotatedTypeFactory,- PropertyKeyAnnotatedTypeFactory,- PurityAnnotatedTypeFactory,- RegexAnnotatedTypeFactory,- ResourceLeakAnnotatedTypeFactory,- ReturnsReceiverAnnotatedTypeFactory,- SameLenAnnotatedTypeFactory,- SearchIndexAnnotatedTypeFactory,- SignatureAnnotatedTypeFactory,- SignednessAnnotatedTypeFactory,- SqlQuotesAnnotatedTypeFactory,- SubstringIndexAnnotatedTypeFactory,- SubtypingAnnotatedTypeFactory,- TaintingAnnotatedTypeFactory,- TypeOutputtingChecker.GeneralAnnotatedTypeFactory,- UnitsAnnotatedTypeFactory,- UpperBoundAnnotatedTypeFactory,- ValueAnnotatedTypeFactory
public interface AnnotationProvider
An implementation of AnnotationProvider returns annotations on Java AST elements.
- 
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 or an alias of it, used to annotate the element.booleanisDeterministic(ExecutableElement methodElement) Returns true if the given method is deterministic according to this AnnotationProvider — that is, if multiple calls to the given method (with the same arguments) return the same value.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.
- 
Method Details- 
getDeclAnnotationReturns the AnnotationMirror, of the given class or an alias of it, used to annotate the element. Returns null if no annotation equivalent toannoexists onelt.- Parameters:
- elt- the element
- anno- annotation class
- Returns:
- an annotation mirror of class annoonelt, or an equivalent one, or null if none exists onanno
 
- 
getAnnotationMirrorReturn the annotation ontreethat is in the hierarchy that contains the qualifiertarget. Returns null if none exists.- 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.- Parameters:
- methodElement- a method
- Returns:
- true if a call to the method does not undo flow-sensitive type refinement
 
- 
isDeterministicReturns true if the given method is deterministic according to this AnnotationProvider — that is, if multiple calls to the given method (with the same arguments) return the same value.Note that this method takes account of this AnnotationProvider's semantics, whereas org.checkerframework.dataflow.util.PurityUtils#isDeterministicdoes not.- Parameters:
- methodElement- a method
- Returns:
- true if multiple calls to the method (with the same arguments) return the same value
 
 
-