Class DefaultQualifierForUseTypeAnnotator
java.lang.Object
org.checkerframework.framework.type.visitor.AnnotatedTypeScanner<Void,Void>
org.checkerframework.framework.type.typeannotator.TypeAnnotator
org.checkerframework.framework.type.typeannotator.DefaultQualifierForUseTypeAnnotator
- All Implemented Interfaces:
AnnotatedTypeVisitor<Void,
Void>
Implements support for
DefaultQualifierForUse
and NoDefaultQualifierForUse
.-
Nested Class Summary
Nested classes/interfaces inherited from class org.checkerframework.framework.type.visitor.AnnotatedTypeScanner
AnnotatedTypeScanner.Reduce<R>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Map<Element,
Set<AnnotationMirror>> Cache of elements to the set of annotations that should be applied to unannotated uses of the element.Fields inherited from class org.checkerframework.framework.type.typeannotator.TypeAnnotator
typeFactory
Fields inherited from class org.checkerframework.framework.type.visitor.AnnotatedTypeScanner
defaultResult, reduceFunction, visitedNodes
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultQualifierForUseTypeAnnotator
(AnnotatedTypeFactory typeFactory) Creates an DefaultQualifierForUseTypeAnnotator fortypeFactory
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears all caches.protected Set<AnnotationMirror>
getDefaultAnnosForUses
(Element element) Returns the set of qualifiers that should be applied to unannotated uses of this element.protected Set<AnnotationMirror>
getDefaultQualifierForUses
(Element element) Return the default qualifiers for uses ofelement
as specified by aDefaultQualifierForUse
annotation.protected Set<AnnotationMirror>
getExplicitAnnos
(Element element) Return the annotations explicitly written on the element.protected Set<AnnotationMirror>
getHierarchiesNoDefault
(Element element) Returns top annotations in hierarchies for which no default for use qualifier should be added.protected final AnnotationMirrorSet
supportedAnnosFromAnnotationMirror
(List<@CanonicalName Name> annoClassNames) Returns the set of qualifiers supported by this type system from the value element ofannotationMirror
.protected final AnnotationMirrorSet
supportedAnnosFromAnnotationMirror
(AnnotationMirror annotationMirror) Deprecated.visitDeclared
(AnnotatedTypeMirror.AnnotatedDeclaredType type, Void aVoid) Visits a declared type.Methods inherited from class org.checkerframework.framework.type.typeannotator.TypeAnnotator
visitExecutable
Methods inherited from class org.checkerframework.framework.type.visitor.AnnotatedTypeScanner
reduce, reset, scan, scan, scanAndReduce, scanAndReduce, visit, visit, visitArray, visitIntersection, visitNoType, visitNull, visitPrimitive, visitTypeVariable, visitUnion, visitWildcard
-
Field Details
-
elementToDefaults
Cache of elements to the set of annotations that should be applied to unannotated uses of the element.
-
-
Constructor Details
-
DefaultQualifierForUseTypeAnnotator
Creates an DefaultQualifierForUseTypeAnnotator fortypeFactory
.- Parameters:
typeFactory
- the type factory
-
-
Method Details
-
visitDeclared
Description copied from interface:AnnotatedTypeVisitor
Visits a declared type.- Specified by:
visitDeclared
in interfaceAnnotatedTypeVisitor<Void,
Void> - Overrides:
visitDeclared
in classAnnotatedTypeScanner<Void,
Void> - Parameters:
type
- the type to visitaVoid
- a visitor-specified parameter- Returns:
- a visitor-specified result
-
clearCache
public void clearCache()Clears all caches. -
getDefaultAnnosForUses
Returns the set of qualifiers that should be applied to unannotated uses of this element. -
getExplicitAnnos
Return the annotations explicitly written on the element. -
getDefaultQualifierForUses
Return the default qualifiers for uses ofelement
as specified by aDefaultQualifierForUse
annotation.Subclasses may override to use an annotation other than
DefaultQualifierForUse
.- Parameters:
element
- an element- Returns:
- the default qualifiers for uses of
element
-
getHierarchiesNoDefault
Returns top annotations in hierarchies for which no default for use qualifier should be added. -
supportedAnnosFromAnnotationMirror
@Deprecated protected final AnnotationMirrorSet supportedAnnosFromAnnotationMirror(AnnotationMirror annotationMirror) Deprecated.Returns the set of qualifiers supported by this type system from the value element ofannotationMirror
.- Parameters:
annotationMirror
- a non-null annotation with a value element that is an array of annotation classes- Returns:
- the set of qualifiers supported by this type system from the value element of
annotationMirror
-
supportedAnnosFromAnnotationMirror
protected final AnnotationMirrorSet supportedAnnosFromAnnotationMirror(List<@CanonicalName Name> annoClassNames) Returns the set of qualifiers supported by this type system from the value element ofannotationMirror
.- Parameters:
annoClassNames
- a list of annotation class names- Returns:
- the set of qualifiers supported by this type system from the value element of
annotationMirror
-
supportedAnnosFromAnnotationMirror(List)