public class ExpectedTreesVisitor extends TreeScannerWithDefaults
getTrees()
returns all the trees that should match with
some JavaParser node. Some trees shouldn't be matched with a JavaParser node because there isn't
a corresponding JavaParser node. These trees are excluded.
The primary purpose is to test the JointJavacJavaParserVisitor
class when the -AajavaChecks
flag is used. That class traverses a javac tree and JavaParser AST simultaneously,
so the trees this class stores can be used to test if the entirety of the javac tree was visited.
Constructor and Description |
---|
ExpectedTreesVisitor() |
scan, visitAnnotatedType, visitArrayAccess, visitArrayType, visitAssert, visitAssignment, visitBinary, visitBlock, visitBreak, visitCase, visitCatch, visitCompilationUnit, visitCompoundAssignment, visitConditionalExpression, visitContinue, visitEmptyStatement, visitEnhancedForLoop, visitErroneous, visitExports, visitIdentifier, visitInstanceOf, visitIntersectionType, visitLabeledStatement, visitLiteral, visitMemberReference, visitMemberSelect, visitModule, visitOpens, visitOther, visitPackage, visitParameterizedType, visitParenthesized, visitPrimitiveType, visitProvides, visitRequires, visitReturn, visitThrow, visitTry, visitTypeCast, visitTypeParameter, visitUnary, visitUnionType, visitUses, visitWildcard
reduce, scan
public Set<Tree> getTrees()
public void defaultAction(Tree tree)
tree
should have a corresponding JavaParser node.defaultAction
in class TreeScannerWithDefaults
tree
- the tree to recordpublic Void visitAnnotation(AnnotationTree tree, Void p)
visitAnnotation
in interface TreeVisitor<Void,Void>
visitAnnotation
in class TreeScannerWithDefaults
public Void visitBindingPattern17(Tree tree, Void p)
TreeScannerWithDefaults
visitBindingPattern17
in class TreeScannerWithDefaults
tree
- a binding pattern treep
- nullpublic Void visitClass(ClassTree tree, Void p)
visitClass
in interface TreeVisitor<Void,Void>
visitClass
in class TreeScannerWithDefaults
public Void visitExpressionStatement(ExpressionStatementTree tree, Void p)
visitExpressionStatement
in interface TreeVisitor<Void,Void>
visitExpressionStatement
in class TreeScannerWithDefaults
public Void visitForLoop(ForLoopTree tree, Void p)
visitForLoop
in interface TreeVisitor<Void,Void>
visitForLoop
in class TreeScannerWithDefaults
public Void visitSwitch(SwitchTree tree, Void p)
visitSwitch
in interface TreeVisitor<Void,Void>
visitSwitch
in class TreeScannerWithDefaults
public Void visitSwitchExpression17(Tree tree, Void p)
TreeScannerWithDefaults
visitSwitchExpression17
in class TreeScannerWithDefaults
tree
- switch expression treep
- nullpublic Void visitSynchronized(SynchronizedTree tree, Void p)
visitSynchronized
in interface TreeVisitor<Void,Void>
visitSynchronized
in class TreeScannerWithDefaults
public Void visitIf(IfTree tree, Void p)
visitIf
in interface TreeVisitor<Void,Void>
visitIf
in class TreeScannerWithDefaults
public Void visitImport(ImportTree tree, Void p)
visitImport
in interface TreeVisitor<Void,Void>
visitImport
in class TreeScannerWithDefaults
public Void visitMethod(MethodTree tree, Void p)
visitMethod
in interface TreeVisitor<Void,Void>
visitMethod
in class TreeScannerWithDefaults
public Void visitMethodInvocation(MethodInvocationTree tree, Void p)
visitMethodInvocation
in interface TreeVisitor<Void,Void>
visitMethodInvocation
in class TreeScannerWithDefaults
public Void visitModifiers(ModifiersTree tree, Void p)
visitModifiers
in interface TreeVisitor<Void,Void>
visitModifiers
in class TreeScannerWithDefaults
public Void visitNewArray(NewArrayTree tree, Void p)
visitNewArray
in interface TreeVisitor<Void,Void>
visitNewArray
in class TreeScannerWithDefaults
public Void visitNewClass(NewClassTree tree, Void p)
visitNewClass
in interface TreeVisitor<Void,Void>
visitNewClass
in class TreeScannerWithDefaults
public Void visitLambdaExpression(LambdaExpressionTree tree, Void p)
visitLambdaExpression
in interface TreeVisitor<Void,Void>
visitLambdaExpression
in class TreeScannerWithDefaults
public Void visitWhileLoop(WhileLoopTree tree, Void p)
visitWhileLoop
in interface TreeVisitor<Void,Void>
visitWhileLoop
in class TreeScannerWithDefaults
public Void visitDoWhileLoop(DoWhileLoopTree tree, Void p)
visitDoWhileLoop
in interface TreeVisitor<Void,Void>
visitDoWhileLoop
in class TreeScannerWithDefaults
public Void visitVariable(VariableTree tree, Void p)
visitVariable
in interface TreeVisitor<Void,Void>
visitVariable
in class TreeScannerWithDefaults
public Void visitYield17(Tree tree, Void p)
TreeScannerWithDefaults
visitYield17
in class TreeScannerWithDefaults
tree
- a yield treep
- null