public class DefaultQualifierForUseTypeAnnotator extends TypeAnnotator
DefaultQualifierForUse and NoDefaultQualifierForUse.| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<javax.lang.model.element.Element,java.util.Set<javax.lang.model.element.AnnotationMirror>> |
elementToDefaults
Cache of elements to the set of annotations that should be applied to unannotated uses of the
element.
|
typeFactoryvisitedNodes| Constructor and Description |
|---|
DefaultQualifierForUseTypeAnnotator(AnnotatedTypeFactory typeFactory)
Creates an DefaultQualifierForUseTypeAnnotator for
typeFactory |
| Modifier and Type | Method and Description |
|---|---|
void |
clearCache()
Clears all caches.
|
protected java.util.Set<javax.lang.model.element.AnnotationMirror> |
getDefaultAnnosForUses(javax.lang.model.element.Element element)
Returns the set of qualifiers that should be applied to unannotated uses of this element.
|
protected java.util.Set<javax.lang.model.element.AnnotationMirror> |
getExplicitAnnos(javax.lang.model.element.Element element)
Return the annotations explicitly written on the element.
|
protected java.util.Set<javax.lang.model.element.AnnotationMirror> |
getHierarchiesNoDefault(javax.lang.model.element.Element element)
Returns top annotations in hierarchies for which no default for use qualifier should be
added.
|
protected java.util.Set<javax.lang.model.element.AnnotationMirror> |
getSupportAnnosFromDefaultQualifierForUses(javax.lang.model.element.Element element)
Return the default qualifiers for uses of
element as specified by DefaultQualifierForUse annotation. |
protected AnnotationMirrorSet |
supportedAnnosFromAnnotationMirror(javax.lang.model.element.AnnotationMirror annotationMirror)
Returns the set of qualifiers supported by this type system from the value element of
annotationMirror. |
java.lang.Void |
visitDeclared(AnnotatedTypeMirror.AnnotatedDeclaredType type,
java.lang.Void aVoid)
Visits a declared type.
|
visitExecutablereduce, reset, scan, scan, scanAndReduce, scanAndReduce, visit, visit, visitArray, visitIntersection, visitNoType, visitNull, visitPrimitive, visitTypeVariable, visitUnion, visitWildcardprotected java.util.Map<javax.lang.model.element.Element,java.util.Set<javax.lang.model.element.AnnotationMirror>> elementToDefaults
public DefaultQualifierForUseTypeAnnotator(AnnotatedTypeFactory typeFactory)
typeFactorypublic java.lang.Void visitDeclared(AnnotatedTypeMirror.AnnotatedDeclaredType type, java.lang.Void aVoid)
AnnotatedTypeVisitorvisitDeclared in interface AnnotatedTypeVisitor<java.lang.Void,java.lang.Void>visitDeclared in class AnnotatedTypeScanner<java.lang.Void,java.lang.Void>type - the type to visitaVoid - a visitor-specified parameterpublic void clearCache()
protected java.util.Set<javax.lang.model.element.AnnotationMirror> getDefaultAnnosForUses(javax.lang.model.element.Element element)
protected java.util.Set<javax.lang.model.element.AnnotationMirror> getExplicitAnnos(javax.lang.model.element.Element element)
protected java.util.Set<javax.lang.model.element.AnnotationMirror> getSupportAnnosFromDefaultQualifierForUses(javax.lang.model.element.Element element)
element as specified by DefaultQualifierForUse annotation.
Subclass may override to use an annotation other than DefaultQualifierForUse.
protected java.util.Set<javax.lang.model.element.AnnotationMirror> getHierarchiesNoDefault(javax.lang.model.element.Element element)
protected final AnnotationMirrorSet supportedAnnosFromAnnotationMirror(javax.lang.model.element.AnnotationMirror annotationMirror)
annotationMirror.annotationMirror - a non-null annotation with a value element that is an array of
annotation classes.annotationMirror