Class QualifierUpperBounds

java.lang.Object
org.checkerframework.framework.type.QualifierUpperBounds

public class QualifierUpperBounds extends Object
Class that computes and stores the qualifier upper bounds for type uses.
  • Constructor Details

    • QualifierUpperBounds

      public QualifierUpperBounds(AnnotatedTypeFactory typeFactory)
      Creates a QualifierUpperBounds from the given checker, using that checker to determine the annotations that are in the type hierarchy.
  • Method Details

    • addTypeKind

      public void addTypeKind(TypeKind typeKind, AnnotationMirror theQual)
      Adds the default qualifier, theQual, for the given TypeKind.
      Parameters:
      typeKind - the TypeKind
      theQual - the default qualifier for typeKind
    • addType

      public void addType(Class<?> type, AnnotationMirror theQual)
      Adds the default qualifier, theQual, for the given class.
      Parameters:
      type - the class
      theQual - the default qualifier for type
    • getBoundQualifiers

      public AnnotationMirrorSet getBoundQualifiers(TypeMirror type)
      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

      public AnnotationMirrorSet limitToBound(TypeMirror type, Set<? extends AnnotationMirror> annos)
      Returns annos, with each qualifier that is not a subtype of the qualifier upper bound of type in the same hierarchy replaced by that bound.
      Parameters:
      type - the type whose qualifier upper bounds limit annos
      annos - the qualifiers to limit
      Returns:
      annos, with each qualifier that is not a subtype of the qualifier upper bound of type in the same hierarchy replaced by that bound
    • getAnnotationFromElement

      protected AnnotationMirrorSet getAnnotationFromElement(Element element)
      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