Class QualifierUpperBounds
java.lang.Object
org.checkerframework.framework.type.QualifierUpperBounds
Class that computes and stores the qualifier upper bounds for type uses.
-
Constructor Summary
ConstructorsConstructorDescriptionQualifierUpperBounds(AnnotatedTypeFactory typeFactory) Creates aQualifierUpperBoundsfrom the given checker, using that checker to determine the annotations that are in the type hierarchy. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddType(Class<?> type, AnnotationMirror theQual) Adds the default qualifier,theQual, for the given class.voidaddTypeKind(TypeKind typeKind, AnnotationMirror theQual) Adds the default qualifier,theQual, for the given TypeKind.protected AnnotationMirrorSetgetAnnotationFromElement(Element element) Returns the explicit annotations on the element.getBoundQualifiers(TypeMirror type) Returns the set of qualifiers that are the upper bounds for a use of the type.limitToBound(TypeMirror type, Set<? extends AnnotationMirror> annos) Returnsannos, with each qualifier that is not a subtype of the qualifier upper bound oftypein the same hierarchy replaced by that bound.
-
Constructor Details
-
QualifierUpperBounds
Creates aQualifierUpperBoundsfrom the given checker, using that checker to determine the annotations that are in the type hierarchy.
-
-
Method Details
-
addTypeKind
Adds the default qualifier,theQual, for the given TypeKind.- Parameters:
typeKind- the TypeKindtheQual- the default qualifier fortypeKind
-
addType
Adds the default qualifier,theQual, for the given class.- Parameters:
type- the classtheQual- the default qualifier fortype
-
getBoundQualifiers
Returns the set of qualifiers that are the upper bounds for a use of the type.- Parameters:
type- the TypeMirror- Returns:
- the set of qualifiers that are the upper bounds for a use of the type
-
limitToBound
Returnsannos, with each qualifier that is not a subtype of the qualifier upper bound oftypein the same hierarchy replaced by that bound.- Parameters:
type- the type whose qualifier upper bounds limitannosannos- the qualifiers to limit- Returns:
annos, with each qualifier that is not a subtype of the qualifier upper bound oftypein the same hierarchy replaced by that bound
-
getAnnotationFromElement
Returns the explicit annotations on the element. Subclasses can override this behavior to add annotations.- Parameters:
element- element whose annotations to return- Returns:
- the explicit annotations on the element
-