Interface Criterion
- All Known Implementing Classes:
ASTPathCriterion
,BoundLocationCriterion
,CallCriterion
,CastCriterion
,ClassBoundCriterion
,ExtImplsLocationCriterion
,FieldCriterion
,GenericArrayLocationCriterion
,InClassCriterion
,InFieldInitCriterion
,InInitBlockCriterion
,InstanceOfCriterion
,IntersectionTypeLocationCriterion
,IsSigMethodCriterion
,LambdaCriterion
,LocalVariableCriterion
,MemberReferenceCriterion
,MethodBoundCriterion
,NewCriterion
,ParamCriterion
,ReceiverCriterion
,ReturnTypeCriterion
,TypeArgumentCriterion
public interface Criterion
A criterion for locating a program element in an AST. A Criterion does not actually give a
location. Given a location, the isSatisfiedBy method indicates whether that location is a desired
one.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiongetKind()
Gets the type 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.
-
Method Details
-
isSatisfiedBy
Determines if the given tree path is satisfied by this 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 asthis.isSatisfiedBy(path.getParentPath())
.- Returns:
- true if this criterion is satisfied by the given path, false otherwise
-
isSatisfiedBy
Determines if the given tree path is satisfied by this 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 asthis.isSatisfiedBy(path.getParentPath())
.- Returns:
- true if this criterion is satisfied by the given path, false otherwise
-
isOnlyTypeAnnotationCriterion
boolean isOnlyTypeAnnotationCriterion()Returns true if this Criterion only permits type annotations, not declaration annotations.- Returns:
- true if this Criterion only permits type annotations, not declaration annotations
-
getKind
Criterion.Kind getKind()Gets the type of this criterion.- Returns:
- this criterion's kind
-