public class DefaultQualifierPolymorphism extends AbstractQualifierPolymorphism
AbstractQualifierPolymorphism
. The polymorphic qualifiers for a
checker that uses this class are found by searching all supported qualifiers. Instantiations of a
polymorphic qualifier are combined using lub.atypeFactory, polyInstantiationForQualifierParameter, polyQuals, qualHierarchy, topQuals
Constructor and Description |
---|
DefaultQualifierPolymorphism(ProcessingEnvironment env,
AnnotatedTypeFactory factory)
Creates a
DefaultQualifierPolymorphism instance that uses factory for
querying type qualifiers and for getting annotated types. |
Modifier and Type | Method and Description |
---|---|
protected AnnotationMirror |
combine(AnnotationMirror polyQual,
AnnotationMirror a1,
AnnotationMirror a2)
Combines the two annotations using the least upper bound.
|
protected void |
replace(AnnotatedTypeMirror type,
AnnotationMirrorMap<AnnotationMirror> replacements)
Replaces the top-level polymorphic annotations in
type with the instantiations in
replacements . |
public DefaultQualifierPolymorphism(ProcessingEnvironment env, AnnotatedTypeFactory factory)
DefaultQualifierPolymorphism
instance that uses factory
for
querying type qualifiers and for getting annotated types.env
- the processing environmentfactory
- the factory for the current checkerprotected void replace(AnnotatedTypeMirror type, AnnotationMirrorMap<AnnotationMirror> replacements)
AbstractQualifierPolymorphism
type
with the instantiations in
replacements
.
This method is called on all parts of a type.
replace
in class AbstractQualifierPolymorphism
type
- AnnotatedTypeMirror whose poly annotations are replaced; it is side-effected by
this methodreplacements
- mapping from polymorphic annotation to instantiationprotected AnnotationMirror combine(AnnotationMirror polyQual, AnnotationMirror a1, AnnotationMirror a2)
combine
in class AbstractQualifierPolymorphism
polyQual
- polymorphic qualifier for which a1
and a2
are instantiationsa1
- an annotation that is an instantiation of polyQual
a2
- an annotation that is an instantiation of polyQual