public class TypeMirrorConverter<Q> extends Object
QualifiedTypeMirror
and AnnotatedTypeMirror.
Only adapters should ever have a reference to this class. All adapters for
a single type system must use the same TypeMirrorConverter instance,
since converting from QualifiedTypeMirror to AnnotatedTypeMirror and back will fail if the two conversion steps are
performed with different instances.| Modifier and Type | Class and Description |
|---|---|
static interface |
TypeMirrorConverter.Key |
| Modifier and Type | Field and Description |
|---|---|
LinkedHashMap<Integer,AnnotationMirror> |
keyToAnnoCache
Cache @Key annotation mirrors so they are not to be recreated on every conversion
|
| Constructor and Description |
|---|
TypeMirrorConverter(ProcessingEnvironment processingEnv,
CheckerAdapter<Q> checkerAdapter) |
| Modifier and Type | Method and Description |
|---|---|
void |
applyQualifiers(QualifiedTypeMirror<Q> qtm,
AnnotatedTypeMirror atm)
Given a QualifiedTypeMirror and an AnnotatedTypeMirror with the same
underlying TypeMirror, recursively update annotations on the
AnnotatedTypeMirror to match the qualifiers present on the
QualifiedTypeMirror.
|
AnnotatedTypeMirror |
getAnnotatedType(QualifiedTypeMirror<Q> qtm)
Given a QualifiedTypeMirror, produce an AnnotatedTypeMirror with the
same underlying TypeMirror and with annotations corresponding to the
qualifiers on the input QualifiedTypeMirror.
|
List<AnnotatedTypeMirror> |
getAnnotatedTypeList(List<? extends QualifiedTypeMirror<Q>> qtms) |
AnnotationMirror |
getAnnotation(Q qual)
Get an AnnotationMirror for a Key annotation encoding the specified
qualifier.
|
AnnotationMirror |
getBlankKeyAnnotation()
Get a Key annotation containing no index.
|
QualifiedTypeMirror<Q> |
getQualifiedType(AnnotatedTypeMirror atm)
Given an AnnotatedTypeMirror, construct a QualifiedTypeMirror with the
same underlying type with the qualifiers extracted from the
AnnotatedTypeMirror's @Key annotations.
|
List<QualifiedTypeMirror<Q>> |
getQualifiedTypeList(List<? extends AnnotatedTypeMirror> atms) |
Q |
getQualifier(AnnotatedTypeMirror atm)
Get the qualifier corresponding to the Key annotation present on an
AnnotatedTypeMirror, or null if no such annotation exists.
|
Q |
getQualifier(AnnotationMirror anno)
Get the qualifier corresponding to a Key annotation.
|
boolean |
isKey(AnnotationMirror anno)
Check if an AnnotationMirror is a valid Key annotation.
|
public LinkedHashMap<Integer,AnnotationMirror> keyToAnnoCache
public TypeMirrorConverter(ProcessingEnvironment processingEnv, CheckerAdapter<Q> checkerAdapter)
public void applyQualifiers(QualifiedTypeMirror<Q> qtm, AnnotatedTypeMirror atm)
public AnnotatedTypeMirror getAnnotatedType(QualifiedTypeMirror<Q> qtm)
public List<AnnotatedTypeMirror> getAnnotatedTypeList(List<? extends QualifiedTypeMirror<Q>> qtms)
public QualifiedTypeMirror<Q> getQualifiedType(AnnotatedTypeMirror atm)
public List<QualifiedTypeMirror<Q>> getQualifiedTypeList(List<? extends AnnotatedTypeMirror> atms)
public Q getQualifier(AnnotationMirror anno)
public Q getQualifier(AnnotatedTypeMirror atm)
public AnnotationMirror getAnnotation(Q qual)
public boolean isKey(AnnotationMirror anno)
public AnnotationMirror getBlankKeyAnnotation()