Class GenericArrayLocationCriterion
java.lang.Object
org.checkerframework.afu.annotator.find.GenericArrayLocationCriterion
- All Implemented Interfaces:
Criterion
GenericArrayLocationCriterion represents the criterion specifying the location of an element in
the generic/array hierarchy as specified by the JSR 308 proposal.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.checkerframework.afu.annotator.find.Criterion
Criterion.Kind
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new GenericArrayLocationCriterion specifying that the element is an outer type, such as:@A List<Integer>
orInteger @A []
GenericArrayLocationCriterion
(List<TypePathEntry> location) Creates a new GenericArrayLocationCriterion representing the end of the given path.GenericArrayLocationCriterion
(org.objectweb.asm.TypePath typePath) Creates a new GenericArrayLocationCriterion representing the end of the given path. -
Method Summary
Modifier and TypeMethodDescriptiongetKind()
Gets the type of this criterion.Gets the type path location of this criterion.boolean
Returns true if this Criterion only permits type annotations, not declaration annotations.boolean
isSatisfiedBy
(@Nullable TreePath path) Determines if the given tree path is satisfied by this criterion.boolean
isSatisfiedBy
(@Nullable TreePath path, Tree leaf) Determines if the given tree path is satisfied by this criterion.toString()
-
Constructor Details
-
GenericArrayLocationCriterion
public GenericArrayLocationCriterion()Creates a new GenericArrayLocationCriterion specifying that the element is an outer type, such as:@A List<Integer>
orInteger @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
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
Description copied from interface:Criterion
Determines if the given tree path is satisfied by this criterion.- Specified by:
isSatisfiedBy
in interfaceCriterion
- Parameters:
path
- the tree path to check against. May be null (in which case the result is false), for example in a call such asthis.isSatisfiedBy(path.getParentPath())
.- Returns:
- true if this criterion is satisfied by the given path, false otherwise
-
isSatisfiedBy
Description copied from interface:Criterion
Determines if the given tree path is satisfied by this criterion.- Specified by:
isSatisfiedBy
in interfaceCriterion
- Parameters:
path
- the tree path to check against. May be null (in which case the result is false), for example in a call such asthis.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 interfaceCriterion
- Returns:
- true if this Criterion only permits type annotations, not declaration annotations
-
getKind
Description copied from interface:Criterion
Gets the type of this criterion. -
toString
-
getLocation
Gets the type path location of this criterion.- Returns:
- an unmodifiable list of
TypePathEntry
s
-