Class DefaultQualifierPolymorphism
java.lang.Object
org.checkerframework.framework.type.poly.AbstractQualifierPolymorphism
org.checkerframework.framework.type.poly.DefaultQualifierPolymorphism
- All Implemented Interfaces:
QualifierPolymorphism
Default implementation of
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.-
Field Summary
Fields inherited from class org.checkerframework.framework.type.poly.AbstractQualifierPolymorphism
atypeFactory, polyInstantiationForQualifierParameter, polyQuals, polyScanner, qualHierarchy, topQuals
-
Constructor Summary
ConstructorDescriptionCreates aDefaultQualifierPolymorphism
instance that usesfactory
for querying type qualifiers and for getting annotated types. -
Method Summary
Modifier and TypeMethodDescriptionprotected 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 intype
with the instantiations inreplacements
.Methods inherited from class org.checkerframework.framework.type.poly.AbstractQualifierPolymorphism
hasPolymorphicQualifiers, reset, resolve, resolve, resolve, resolve
-
Constructor Details
-
DefaultQualifierPolymorphism
Creates aDefaultQualifierPolymorphism
instance that usesfactory
for querying type qualifiers and for getting annotated types.- Parameters:
env
- the processing environmentfactory
- the factory for the current checker
-
-
Method Details
-
replace
protected void replace(AnnotatedTypeMirror type, AnnotationMirrorMap<AnnotationMirror> replacements) Description copied from class:AbstractQualifierPolymorphism
Replaces the top-level polymorphic annotations intype
with the instantiations inreplacements
.This method is called on all parts of a type.
- Specified by:
replace
in classAbstractQualifierPolymorphism
- Parameters:
type
- AnnotatedTypeMirror whose poly annotations are replaced; it is side-effected by this methodreplacements
- mapping from polymorphic annotation to instantiation
-
combine
protected AnnotationMirror combine(AnnotationMirror polyQual, AnnotationMirror a1, AnnotationMirror a2) Combines the two annotations using the least upper bound.- Specified by:
combine
in classAbstractQualifierPolymorphism
- Parameters:
polyQual
- polymorphic qualifier for whicha1
anda2
are instantiationsa1
- an annotation that is an instantiation ofpolyQual
a2
- an annotation that is an instantiation ofpolyQual
- Returns:
- an annotation that is the combination of the two annotations
-