Class GenericArrayLocationCriterion

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

public class GenericArrayLocationCriterion extends Object implements Criterion
GenericArrayLocationCriterion represents the criterion specifying the location of an element in the generic/array hierarchy as specified by the JSR 308 proposal.
  • Constructor Details

    • GenericArrayLocationCriterion

      public GenericArrayLocationCriterion()
      Creates a new GenericArrayLocationCriterion specifying that the element is an outer type, such as: @A List<Integer> or Integer @A []
    • GenericArrayLocationCriterion

      public GenericArrayLocationCriterion(org.objectweb.asm.TypePath typePath)
      Creates a new GenericArrayLocationCriterion representing the end of the given path.
      Parameters:
      typePath - the path to the location of the element being represented
    • GenericArrayLocationCriterion

      public GenericArrayLocationCriterion(List<TypePathEntry> location)
      Creates a new GenericArrayLocationCriterion representing the end of the given path.
      Parameters:
      location - a list of TypePathEntrys to the location of the element being represented
  • Method Details

    • 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
    • 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
    • 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
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getLocation

      public List<TypePathEntry> getLocation()
      Gets the type path location of this criterion.
      Returns:
      an unmodifiable list of TypePathEntrys