Class ASTPathCriterion
java.lang.Object
org.checkerframework.afu.annotator.find.ASTPathCriterion
- All Implemented Interfaces:
Criterion
A criterion to determine if a node matches a path through the AST.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.checkerframework.afu.annotator.find.Criterion
Criterion.Kind
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionASTPathCriterion
(ASTPath astPath) Constructs a new ASTPathCriterion to match the given AST path. -
Method Summary
Modifier and TypeMethodDescriptiongetKind()
Gets the type of this criterion.boolean
isBinaryOperator
(Tree.Kind kind) Determines if the given kind is a binary operator.boolean
isExpression
(Tree.Kind kind) 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()
-
Field Details
-
debug
public static boolean debug
-
-
Constructor Details
-
ASTPathCriterion
Constructs a new ASTPathCriterion to match the given AST path.This assumes that the astPath is valid. Specifically, that all of its arguments have been previously validated.
- Parameters:
astPath
- the AST path to match
-
-
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
-
isBinaryOperator
Determines if the given kind is a binary operator.- Parameters:
kind
- the kind to test- Returns:
- true if the given kind is a binary operator
-
isExpression
-
getKind
Description copied from interface:Criterion
Gets the type of this criterion. -
toString
-