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.
|
typeFactorydefaultResult, 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> |
getDefaultQualifierForUses(Element element)
Return the default qualifiers for uses of
element as specified by a DefaultQualifierForUse 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 AnnotationMirrorSet |
supportedAnnosFromAnnotationMirror(AnnotationMirror annotationMirror)
Deprecated.
|
protected AnnotationMirrorSet |
supportedAnnosFromAnnotationMirror(List<Name> annoClassNames)
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.
|
visitExecutablereduce, reset, scan, scan, scanAndReduce, scanAndReduce, visit, visit, visitArray, visitIntersection, visitNoType, visitNull, visitPrimitive, visitTypeVariable, visitUnion, visitWildcardprotected Map<Element,Set<AnnotationMirror>> elementToDefaults
public DefaultQualifierForUseTypeAnnotator(AnnotatedTypeFactory typeFactory)
typeFactory.typeFactory - the type factorypublic Void visitDeclared(AnnotatedTypeMirror.AnnotatedDeclaredType type, Void aVoid)
AnnotatedTypeVisitorvisitDeclared 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> getDefaultQualifierForUses(Element element)
element as specified by a DefaultQualifierForUse annotation.
Subclasses may override to use an annotation other than DefaultQualifierForUse.
element - an elementelementprotected Set<AnnotationMirror> getHierarchiesNoDefault(Element element)
@Deprecated protected final AnnotationMirrorSet supportedAnnosFromAnnotationMirror(AnnotationMirror annotationMirror)
supportedAnnosFromAnnotationMirror(List)annotationMirror.annotationMirror - a non-null annotation with a value element that is an array of
annotation classesannotationMirrorprotected final AnnotationMirrorSet supportedAnnosFromAnnotationMirror(List<Name> annoClassNames)
annotationMirror.annoClassNames - a list of annotation class namesannotationMirror