public class DefaultQualifierForUseTypeAnnotator extends TypeAnnotator
DefaultQualifierForUse
and NoDefaultQualifierForUse
.AnnotatedTypeScanner.Reduce<R>
Modifier and Type | Field and Description |
---|---|
protected Map<Element,Set<AnnotationMirror>> |
elementToDefaults
Cache of elements to the set of annotations that should be applied to unannotated uses of the
element.
|
typeFactory
defaultResult, reduceFunction, visitedNodes
Constructor and Description |
---|
DefaultQualifierForUseTypeAnnotator(AnnotatedTypeFactory typeFactory)
Creates an DefaultQualifierForUseTypeAnnotator for
typeFactory |
Modifier and Type | Method and Description |
---|---|
void |
clearCache()
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> |
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 Set<AnnotationMirror> |
getSupportAnnosFromDefaultQualifierForUses(Element element)
Return the default qualifiers for uses of
element as specified by DefaultQualifierForUse annotation. |
protected AnnotationMirrorSet |
supportedAnnosFromAnnotationMirror(AnnotationMirror annotationMirror)
Returns the set of qualifiers supported by this type system from the value element of
annotationMirror . |
Void |
visitDeclared(AnnotatedTypeMirror.AnnotatedDeclaredType type,
Void aVoid)
Visits a declared type.
|
visitExecutable
reduce, reset, scan, scan, scanAndReduce, scanAndReduce, visit, visit, visitArray, visitIntersection, visitNoType, visitNull, visitPrimitive, visitTypeVariable, visitUnion, visitWildcard
protected Map<Element,Set<AnnotationMirror>> elementToDefaults
public DefaultQualifierForUseTypeAnnotator(AnnotatedTypeFactory typeFactory)
typeFactory
public Void visitDeclared(AnnotatedTypeMirror.AnnotatedDeclaredType type, Void aVoid)
AnnotatedTypeVisitor
visitDeclared
in interface AnnotatedTypeVisitor<Void,Void>
visitDeclared
in class AnnotatedTypeScanner<Void,Void>
type
- the type to visitaVoid
- a visitor-specified parameterpublic void clearCache()
protected Set<AnnotationMirror> getDefaultAnnosForUses(Element element)
protected Set<AnnotationMirror> getExplicitAnnos(Element element)
protected Set<AnnotationMirror> getSupportAnnosFromDefaultQualifierForUses(Element element)
element
as specified by DefaultQualifierForUse
annotation.
Subclass may override to use an annotation other than DefaultQualifierForUse
.
protected Set<AnnotationMirror> getHierarchiesNoDefault(Element element)
protected final AnnotationMirrorSet supportedAnnosFromAnnotationMirror(AnnotationMirror annotationMirror)
annotationMirror
.annotationMirror
- a non-null annotation with a value element that is an array of
annotation classesannotationMirror