java.lang.Object
org.checkerframework.framework.util.typeinference8.types.AbstractQualifier
Direct Known Subclasses:
Qualifier, QualifierVar

public abstract class AbstractQualifier extends Object
This is the super class for a qualifier, Qualifier or a qualifier variable, QualifierVar. A Qualifier is a wrapper around AnnotationMirror. A QualifierVar is a variable for a polymorphic qualifier that needs to be viewpoint adapted at a call site.
  • Field Details

    • hierarchyName

      protected final @Interned String hierarchyName
      The (interned) name of the top qualifier in the same hierarchy as the qualifier.
    • context

      protected final Java8InferenceContext context
      The context.
  • Method Details

    • sameHierarchy

      public boolean sameHierarchy(AbstractQualifier other)
      Returns whether other is in the same hierarchy as this.
      Parameters:
      other - another abstract qualifier
      Returns:
      whether other is in the same hierarchy as this.
    • lub

      public static Set<AnnotationMirror> lub(Set<AbstractQualifier> quals, Java8InferenceContext context)
      Returns the least upper bounds of quals.
      Parameters:
      quals - a set of qualifiers; can contain multiple qualifiers for multiple hierarchies and multiple qualifiers for a hierarchy
      context - a context
      Returns:
      the least upper bounds of quals
    • glb

      public static Set<AnnotationMirror> glb(Set<AbstractQualifier> quals, Java8InferenceContext context)
      Returns the greatest lower bounds of quals.
      Parameters:
      quals - a set of qualifiers; can contain multiple qualifiers for multiple hierarchies and multiple qualifiers for a hierarchy
      context - a context
      Returns:
      the greatest lowest bounds of quals
    • create

      public static Set<AbstractQualifier> create(Set<AnnotationMirror> annos, AnnotationMirrorMap<QualifierVar> qualifierVars, Java8InferenceContext context)
      Creates an AbstractQualifier for each AnnotationMirror in annos. If an annotation mirror is a polymorphic qualifier in qualifierVars, the QualifierVar it maps to in qualifierVars is added to the returned set. Otherwise, a new Qualifier is added.
      Parameters:
      annos - a set of annotation mirrors
      qualifierVars - a map from polymorphic qualifiers to QualifierVar
      context - a context
      Returns:
      a set containing an AbstractQualifier for each annotation in qualifierVars