Class ClassValAnnotatedTypeFactory.ClassValQualifierHierarchy

java.lang.Object
org.checkerframework.framework.type.ElementQualifierHierarchy
org.checkerframework.common.reflection.ClassValAnnotatedTypeFactory.ClassValQualifierHierarchy
All Implemented Interfaces:
QualifierHierarchy
Enclosing class:
ClassValAnnotatedTypeFactory

protected class ClassValAnnotatedTypeFactory.ClassValQualifierHierarchy extends ElementQualifierHierarchy
The qualifier hierarchy for the ClassVal type system.
  • Constructor Details

    • ClassValQualifierHierarchy

      public ClassValQualifierHierarchy(Set<Class<? extends Annotation>> qualifierClasses, Elements elements)
      Creates a ClassValQualifierHierarchy from the given classes.
      Parameters:
      qualifierClasses - classes of annotations that are the qualifiers for this hierarchy
      elements - element utils
  • Method Details

    • leastUpperBound

      public AnnotationMirror leastUpperBound(AnnotationMirror a1, AnnotationMirror a2)
      Description copied from interface: QualifierHierarchy
      Returns the least upper bound (LUB) of the qualifiers qualifier1 and qualifier2. Returns null if the qualifiers are not from the same qualifier hierarchy.

      Examples:

      • For NonNull, leastUpperBound('Nullable', 'NonNull') ⇒ Nullable
      Parameters:
      a1 - the first qualifier; may not be in the same hierarchy as qualifier2
      a2 - the second qualifier; may not be in the same hierarchy as qualifier1
      Returns:
      the least upper bound of the qualifiers, or null if the qualifiers are from different hierarchies
    • greatestLowerBound

      public AnnotationMirror greatestLowerBound(AnnotationMirror a1, AnnotationMirror a2)
      Description copied from interface: QualifierHierarchy
      Returns the greatest lower bound for the qualifiers qualifier1 and qualifier2. Returns null if the qualifiers are not from the same qualifier hierarchy.
      Parameters:
      a1 - first qualifier
      a2 - second qualifier
      Returns:
      greatest lower bound of the two annotations or null if the two annotations are not from the same hierarchy
    • isSubtype

      public boolean isSubtype(AnnotationMirror subAnno, AnnotationMirror superAnno)
      Description copied from interface: QualifierHierarchy
      Tests whether subQualifier is equal to or a sub-qualifier of superQualifier, according to the type qualifier hierarchy.
      Parameters:
      subAnno - possible subqualifier of superQualifier
      superAnno - possible superqualifier of subQualifier
      Returns:
      true iff subQualifier is a subqualifier of, or equal to, superQualifier