Class InClassCriterion

java.lang.Object
org.checkerframework.afu.annotator.find.InClassCriterion
All Implemented Interfaces:
Criterion

public final class InClassCriterion extends Object implements Criterion
Represents the criterion that a program element is in a class with a particular name.
  • Field Details

  • Constructor Details

    • InClassCriterion

      public InClassCriterion(@ClassGetName String className, boolean exactMatch)
      Creates a new InClassCriterion.
      Parameters:
      className - the class name
      exactMatch - if true, require an exact match
  • Method Details

    • getKind

      public Criterion.Kind getKind()
      Description copied from interface: Criterion
      Gets the type of this criterion.
      Specified by:
      getKind in interface Criterion
      Returns:
      this criterion's kind
    • isSatisfiedBy

      public boolean isSatisfiedBy(@Nullable TreePath path, @FindDistinct Tree leaf)
      Description copied from interface: Criterion
      Determines if the given tree path is satisfied by this criterion.
      Specified by:
      isSatisfiedBy in interface Criterion
      Parameters:
      path - the tree path to check against. May be null (in which case the result is false), for example in a call such as this.isSatisfiedBy(path.getParentPath()).
      Returns:
      true if this criterion is satisfied by the given path, false otherwise
    • isSatisfiedBy

      public boolean isSatisfiedBy(@Nullable TreePath path)
      Description copied from interface: Criterion
      Determines if the given tree path is satisfied by this criterion.
      Specified by:
      isSatisfiedBy in interface Criterion
      Parameters:
      path - the tree path to check against. May be null (in which case the result is false), for example in a call such as this.isSatisfiedBy(path.getParentPath()).
      Returns:
      true if this criterion is satisfied by the given path, false otherwise
    • isSatisfiedBy

      public static boolean isSatisfiedBy(@Nullable TreePath path, String className, boolean exactMatch)
    • isOnlyTypeAnnotationCriterion

      public boolean isOnlyTypeAnnotationCriterion()
      Description copied from interface: Criterion
      Returns true if this Criterion only permits type annotations, not declaration annotations.
      Specified by:
      isOnlyTypeAnnotationCriterion in interface Criterion
      Returns:
      true if this Criterion only permits type annotations, not declaration annotations
    • toString

      public String toString()
      Overrides:
      toString in class Object