Class MatchesParentVisitor
- java.lang.Object
-
- com.pressassociation.pr.ast.visitor.AstVisitor
-
- com.pressassociation.pr.ast.visitor.TransformingVisitor<Boolean>
-
- com.pressassociation.pr.ast.visitor.MatchesParentVisitor
-
public class MatchesParentVisitor extends TransformingVisitor<Boolean>
Visitor that will return a boolean to signify whether the path given in the constructor matches the Ast we visit.- Author:
- Matt Nathan
-
-
Constructor Summary
Constructors Constructor Description MatchesParentVisitor(Iterable<String> pathParts)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanbeforeFieldsNext(Fields fields)Called before the right hand side of a Fields node is visited.protected booleanbeforePathField(Path path)Called before the suffix part of a Path node is visited.protected booleanbeforeSubSelectionFields(SubSelection subSelection)Called before the fields part of a SubSelection is visited.BooleangetResult()Return the result of visiting the AST.voidvisitFields(Fields fields)voidvisitWildcard(Wildcard wildcard)voidvisitWord(Word word)-
Methods inherited from class com.pressassociation.pr.ast.visitor.TransformingVisitor
applyTo, toString
-
Methods inherited from class com.pressassociation.pr.ast.visitor.AstVisitor
afterSubSelectionFields, visitPath, visitSubSelection
-
-
-
-
Method Detail
-
visitFields
public void visitFields(Fields fields)
- Overrides:
visitFieldsin classAstVisitor
-
beforeFieldsNext
protected boolean beforeFieldsNext(Fields fields)
Description copied from class:AstVisitorCalled before the right hand side of a Fields node is visited. Return false to stop processing of that node.- Overrides:
beforeFieldsNextin classAstVisitor
-
beforePathField
protected boolean beforePathField(Path path)
Description copied from class:AstVisitorCalled before the suffix part of a Path node is visited. Return false to stop processing.- Overrides:
beforePathFieldin classAstVisitor
-
beforeSubSelectionFields
protected boolean beforeSubSelectionFields(SubSelection subSelection)
Description copied from class:AstVisitorCalled before the fields part of a SubSelection is visited. Return false to stop processing.- Overrides:
beforeSubSelectionFieldsin classAstVisitor
-
visitWildcard
public void visitWildcard(Wildcard wildcard)
- Overrides:
visitWildcardin classAstVisitor
-
visitWord
public void visitWord(Word word)
- Overrides:
visitWordin classAstVisitor
-
getResult
public Boolean getResult()
Description copied from class:TransformingVisitorReturn the result of visiting the AST.- Specified by:
getResultin classTransformingVisitor<Boolean>
-
-