public abstract class JointJavacJavaParserVisitor extends SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
By default, visits all children of a javac tree along with corresponding JavaParser nodes. The
JavaParser node corresponding to a javac tree is always passed as the secondary parameter to the
visit
methods.
To perform an action on a particular tree type, override one of the methods starting with
"process". For each javac tree type JavacType, and for each possible JavaParser node type
JavaParserNode that it may be matched to, this class contains a method processJavacType(JavacTypeTree javacTree, JavaParserNode javaParserNode)
. These are named after
the visit methods in com.sun.source.tree.TreeVisitor
, but for each javac tree type there
may be multiple process methods for each possible node type it could be matched to.
The process
methods are called in pre-order. That is, process methods for a parent are
called before its children.
DEFAULT_VALUE
Constructor and Description |
---|
JointJavacJavaParserVisitor() |
Modifier and Type | Method and Description |
---|---|
<T> T |
castNode(Class<T> type,
com.github.javaparser.ast.Node javaParserNode,
Tree javacTree)
Cast
javaParserNode to type type and return it. |
protected Void |
defaultAction(Tree tree,
com.github.javaparser.ast.Node node)
The default action for this visitor.
|
static boolean |
isDefaultSuperConstructorCall(StatementTree statement)
Returns whether a javac statement represents a method call
super() . |
static boolean |
isNoArgumentConstructor(Tree member)
Returns whether
member is a javac constructor declaration that takes no arguments. |
abstract void |
processAnnotatedType(AnnotatedTypeTree javacTree,
com.github.javaparser.ast.Node javaParserNode)
Process an
AnnotatedTypeTree . |
abstract void |
processAnnotation(AnnotationTree javacTree,
com.github.javaparser.ast.expr.MarkerAnnotationExpr javaParserNode)
Process an
AnnotationTree with no arguments like @MyAnno . |
abstract void |
processAnnotation(AnnotationTree javacTree,
com.github.javaparser.ast.expr.NormalAnnotationExpr javaParserNode)
Process an
AnnotationTree with multiple key-value pairs like @MyAnno(a=5,
b=10) . |
abstract void |
processAnnotation(AnnotationTree javacTree,
com.github.javaparser.ast.expr.SingleMemberAnnotationExpr javaParserNode)
Process an
AnnotationTree with a single argument like MyAnno(5) . |
abstract void |
processArrayAccess(ArrayAccessTree javacTree,
com.github.javaparser.ast.expr.ArrayAccessExpr javaParserNode)
Process an
ArrayAccessTree . |
abstract void |
processArrayType(ArrayTypeTree javacTree,
com.github.javaparser.ast.type.ArrayType javaParserNode)
Process an
ArrayTypeTree . |
abstract void |
processAssert(AssertTree javacTree,
com.github.javaparser.ast.stmt.AssertStmt javaParserNode)
Process an
AssertTree . |
abstract void |
processAssignment(AssignmentTree javacTree,
com.github.javaparser.ast.expr.AssignExpr javaParserNode)
Process an
AssignmentTree . |
abstract void |
processBinary(BinaryTree javacTree,
com.github.javaparser.ast.expr.BinaryExpr javaParserNode)
Process a
BinaryTree . |
abstract void |
processBlock(BlockTree javacTree,
com.github.javaparser.ast.stmt.BlockStmt javaParserNode)
Process a
BlockTree . |
abstract void |
processBreak(BreakTree javacTree,
com.github.javaparser.ast.stmt.BreakStmt javaParserNode)
Process a
BreakTree . |
abstract void |
processCase(CaseTree javacTree,
com.github.javaparser.ast.stmt.SwitchEntry javaParserNode)
Process a
CaseTree . |
abstract void |
processCatch(CatchTree javacTree,
com.github.javaparser.ast.stmt.CatchClause javaParserNode)
Process a
CatchTree . |
abstract void |
processClass(ClassTree javacTree,
com.github.javaparser.ast.body.AnnotationDeclaration javaParserNode)
Process a
ClassTree representing an annotation declaration. |
abstract void |
processClass(ClassTree javacTree,
com.github.javaparser.ast.body.ClassOrInterfaceDeclaration javaParserNode)
Process a
ClassTree representing a class or interface declaration. |
abstract void |
processClass(ClassTree javacTree,
com.github.javaparser.ast.body.EnumDeclaration javaParserNode)
Process a
ClassTree representing an enum declaration. |
abstract void |
processClass(ClassTree javacTree,
com.github.javaparser.ast.body.RecordDeclaration javaParserNode)
Process a
ClassTree representing a record declaration. |
abstract void |
processCompilationUnit(CompilationUnitTree javacTree,
com.github.javaparser.ast.CompilationUnit javaParserNode)
Process a
CompilationUnitTree . |
abstract void |
processCompoundAssignment(CompoundAssignmentTree javacTree,
com.github.javaparser.ast.expr.AssignExpr javaParserNode)
Process a
CompoundAssignmentTree . |
abstract void |
processConditionalExpression(ConditionalExpressionTree javacTree,
com.github.javaparser.ast.expr.ConditionalExpr javaParserNode)
Process a
ConditionalExpressionTree . |
abstract void |
processContinue(ContinueTree javacTree,
com.github.javaparser.ast.stmt.ContinueStmt javaParserNode)
Process a
ContinueTree . |
abstract void |
processDoWhileLoop(DoWhileLoopTree javacTree,
com.github.javaparser.ast.stmt.DoStmt javaParserNode)
Process a
DoWhileLoopTree . |
abstract void |
processEmptyStatement(EmptyStatementTree javacTree,
com.github.javaparser.ast.stmt.EmptyStmt javaParserNode)
Process an
EmptyStatementTree . |
abstract void |
processEnhancedForLoop(EnhancedForLoopTree javacTree,
com.github.javaparser.ast.stmt.ForEachStmt javaParserNode)
Process an
EnhancedForLoopTree . |
abstract void |
processExports(ExportsTree javacTree,
com.github.javaparser.ast.modules.ModuleExportsDirective javaParserNode)
Process an
ExportsTree . |
abstract void |
processExpressionStatemen(ExpressionStatementTree javacTree,
com.github.javaparser.ast.stmt.ExpressionStmt javaParserNode)
Process an
ExpressionStatementTree . |
abstract void |
processForLoop(ForLoopTree javacTree,
com.github.javaparser.ast.stmt.ForStmt javaParserNode)
Process a
ForLoopTree . |
abstract void |
processIdentifier(IdentifierTree javacTree,
com.github.javaparser.ast.type.ClassOrInterfaceType javaParserNode)
Process an
IdentifierTree representing a class or interface type. |
abstract void |
processIdentifier(IdentifierTree javacTree,
com.github.javaparser.ast.expr.Name javaParserNode)
Process an
IdentifierTree representing a name that may contain dots. |
abstract void |
processIdentifier(IdentifierTree javacTree,
com.github.javaparser.ast.expr.NameExpr javaParserNode)
Process an
IdentifierTree representing an expression that evaluates to the value of a
variable. |
abstract void |
processIdentifier(IdentifierTree javacTree,
com.github.javaparser.ast.expr.SimpleName javaParserNode)
Process an
IdentifierTree representing a name without dots. |
abstract void |
processIdentifier(IdentifierTree javacTree,
com.github.javaparser.ast.expr.SuperExpr javaParserNode)
Process an
IdentifierTree representing a super expression like the super in super.myMethod() or MyClass.super.myMethod() . |
abstract void |
processIdentifier(IdentifierTree javacTree,
com.github.javaparser.ast.expr.ThisExpr javaParserNode)
Process an
IdentifierTree representing a this expression like the this
in MyClass = this , this.myMethod() , or MyClass.this.myMethod() . |
abstract void |
processIf(IfTree javacTree,
com.github.javaparser.ast.stmt.IfStmt javaParserNode)
Process an
IfTree . |
abstract void |
processImport(ImportTree javacTree,
com.github.javaparser.ast.ImportDeclaration javaParserNode)
Process an
ImportTree . |
abstract void |
processInstanceOf(InstanceOfTree javacTree,
com.github.javaparser.ast.expr.InstanceOfExpr javaParserNode)
Process an
InstanceOfTree . |
abstract void |
processIntersectionType(IntersectionTypeTree javacTree,
com.github.javaparser.ast.type.IntersectionType javaParserNode)
Process an
IntersectionType . |
abstract void |
processLabeledStatement(LabeledStatementTree javacTree,
com.github.javaparser.ast.stmt.LabeledStmt javaParserNode)
Process a
LabeledStatement . |
abstract void |
processLambdaExpression(LambdaExpressionTree javacTree,
com.github.javaparser.ast.expr.LambdaExpr javaParserNode)
Process a
LambdaExpressionTree . |
abstract void |
processLiteral(LiteralTree javacTree,
com.github.javaparser.ast.expr.BinaryExpr javaParserNode)
Process a
LiteralTree for a String literal defined using concatenation. |
abstract void |
processLiteral(LiteralTree javacTree,
com.github.javaparser.ast.expr.LiteralExpr javaParserNode)
Process a
LiteralTree . |
abstract void |
processLiteral(LiteralTree javacTree,
com.github.javaparser.ast.expr.UnaryExpr javaParserNode)
Process a
LiteralTree for a literal expression prefixed with + or -
like +5 or -2 . |
abstract void |
processMemberReference(MemberReferenceTree javacTree,
com.github.javaparser.ast.expr.MethodReferenceExpr javaParserNode)
Process a
MemberReferenceTree . |
abstract void |
processMemberSelect(MemberSelectTree javacTree,
com.github.javaparser.ast.expr.ClassExpr javaParserNode)
Process a
MemberSelectTree for a class expression like MyClass.class . |
abstract void |
processMemberSelect(MemberSelectTree javacTree,
com.github.javaparser.ast.type.ClassOrInterfaceType javaParserNode)
Process a
MemberSelectTree for a type with a name containing dots, like mypackage.MyClass . |
abstract void |
processMemberSelect(MemberSelectTree javacTree,
com.github.javaparser.ast.expr.FieldAccessExpr javaParserNode)
Process a
MemberSelectTree for a field access expression like myObj.myField . |
abstract void |
processMemberSelect(MemberSelectTree javacTree,
com.github.javaparser.ast.expr.Name javaParserNode)
Process a
MemberSelectTree for a name that contains dots. |
abstract void |
processMemberSelect(MemberSelectTree javacTree,
com.github.javaparser.ast.expr.SuperExpr javaParserNode)
Process a
MemberSelectTree for a super expression with a class like super.MyClass . |
abstract void |
processMemberSelect(MemberSelectTree javacTree,
com.github.javaparser.ast.expr.ThisExpr javaParserNode)
Process a
MemberSelectTree for a this expression with a class like MyClass.this . |
abstract void |
processMethod(MethodTree javacTree,
com.github.javaparser.ast.body.AnnotationMemberDeclaration javaParserNode)
Process a
MethodTree representing a value field for an annotation. |
abstract void |
processMethod(MethodTree javacTree,
com.github.javaparser.ast.body.CompactConstructorDeclaration javaParserNode)
Process a
MethodTree representing a compact constructor declaration. |
abstract void |
processMethod(MethodTree javacTree,
com.github.javaparser.ast.body.ConstructorDeclaration javaParserNode)
Process a
MethodTree representing a constructor declaration. |
abstract void |
processMethod(MethodTree javacTree,
com.github.javaparser.ast.body.MethodDeclaration javaParserNode)
Process a
MethodTree representing a regular method declaration. |
abstract void |
processMethodInvocation(MethodInvocationTree javacTree,
com.github.javaparser.ast.stmt.ExplicitConstructorInvocationStmt javaParserNode)
Process a
MethodInvocationTree representing a constructor invocation. |
abstract void |
processMethodInvocation(MethodInvocationTree javacTree,
com.github.javaparser.ast.expr.MethodCallExpr javaParserNode)
Process a
MethodInvocationTree representing a regular method invocation. |
abstract void |
processModule(ModuleTree javacTree,
com.github.javaparser.ast.modules.ModuleDeclaration javaParserNode)
Process a
ModuleTree . |
abstract void |
processNewClass(NewClassTree javacTree,
com.github.javaparser.ast.expr.ObjectCreationExpr javaParserNode)
Process a
NewClassTree . |
abstract void |
processOpens(OpensTree javacTree,
com.github.javaparser.ast.modules.ModuleOpensDirective javaParserNode)
Process an
OpensTree . |
abstract void |
processOther(Tree javacTree,
com.github.javaparser.ast.Node javaParserNode)
Process a
Tree that isn't an instance of any specific tree class. |
abstract void |
processPackage(PackageTree javacTree,
com.github.javaparser.ast.PackageDeclaration javaParserNode)
Process a
PackageTree . |
abstract void |
processParameterizedType(ParameterizedTypeTree javacTree,
com.github.javaparser.ast.type.ClassOrInterfaceType javaParserNode)
Process a
ParameterizedTypeTree . |
abstract void |
processParenthesized(ParenthesizedTree javacTree,
com.github.javaparser.ast.expr.EnclosedExpr javaParserNode)
Process a
ParenthesizedTree . |
abstract void |
processPrimitiveType(PrimitiveTypeTree javacTree,
com.github.javaparser.ast.type.PrimitiveType javaParserNode)
Process a
PrimitiveTypeTree . |
abstract void |
processPrimitiveType(PrimitiveTypeTree javacTree,
com.github.javaparser.ast.type.VoidType javaParserNode)
Process a
PrimitiveTypeTree representing a void type. |
abstract void |
processProvides(ProvidesTree javacTree,
com.github.javaparser.ast.modules.ModuleProvidesDirective javaParserNode)
Process a
ProvidesTree . |
abstract void |
processRequires(RequiresTree javacTree,
com.github.javaparser.ast.modules.ModuleRequiresDirective javaParserNode)
Process a
RequiresTree . |
abstract void |
processReturn(ReturnTree javacTree,
com.github.javaparser.ast.stmt.ReturnStmt javaParserNode)
Process a
RetrunTree . |
abstract void |
processSwitch(SwitchTree javacTree,
com.github.javaparser.ast.stmt.SwitchStmt javaParserNode)
Process a
SwitchTree . |
abstract void |
processSynchronized(SynchronizedTree javacTree,
com.github.javaparser.ast.stmt.SynchronizedStmt javaParserNode)
Process a
SynchronizedTree . |
abstract void |
processThrow(ThrowTree javacTree,
com.github.javaparser.ast.stmt.ThrowStmt javaParserNode)
Process a
ThrowTree . |
abstract void |
processTry(TryTree javacTree,
com.github.javaparser.ast.stmt.TryStmt javaParserNode)
Process a
TryTree . |
abstract void |
processTypeCast(TypeCastTree javacTree,
com.github.javaparser.ast.expr.CastExpr javaParserNode)
Process a
TypeCastTree . |
abstract void |
processTypeParameter(TypeParameterTree javacTree,
com.github.javaparser.ast.type.TypeParameter javaParserNode)
Process a
TypeParameterTree . |
abstract void |
processUnary(UnaryTree javacTree,
com.github.javaparser.ast.expr.UnaryExpr javaParserNode)
Process a
UnaryTree . |
abstract void |
processUnionType(UnionTypeTree javacTree,
com.github.javaparser.ast.type.UnionType javaParserNode)
Process a
UnionTypeTree . |
abstract void |
processUses(UsesTree javacTree,
com.github.javaparser.ast.modules.ModuleUsesDirective javaParserNode)
Process a
UsesTree . |
abstract void |
processVariable(VariableTree javacTree,
com.github.javaparser.ast.body.EnumConstantDeclaration javaParserNode)
Process a
VariableTree representing an enum constant declaration. |
abstract void |
processVariable(VariableTree javacTree,
com.github.javaparser.ast.body.Parameter javaParserNode)
Process a
VariableTree representing a parameter to a method or constructor. |
abstract void |
processVariable(VariableTree javacTree,
com.github.javaparser.ast.body.ReceiverParameter javaParserNode)
Process a
VariableTree representing the receiver parameter of a method. |
abstract void |
processVariable(VariableTree javacTree,
com.github.javaparser.ast.body.VariableDeclarator javaParserNode)
Process a
VariableTree representing a regular variable declaration. |
abstract void |
processWhileLoop(WhileLoopTree javacTree,
com.github.javaparser.ast.stmt.WhileStmt javaParserNode)
Process a
WhileLoopTree . |
abstract void |
processWildcard(WildcardTree javacTree,
com.github.javaparser.ast.type.WildcardType javaParserNode)
Process a
WhileLoopTree . |
Void |
visitAnnotatedType(AnnotatedTypeTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitAnnotation(AnnotationTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
void |
visitAnonymousClassBody(ClassTree javacBody,
List<com.github.javaparser.ast.body.BodyDeclaration<?>> javaParserMembers)
Visits the the members of an anonymous class body.
|
Void |
visitArrayAccess(ArrayAccessTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitArrayType(ArrayTypeTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitAssert(AssertTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitAssignment(AssignmentTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitBinary(BinaryTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitBindingPattern17(Tree tree,
com.github.javaparser.ast.Node node)
Visit a BindingPatternTree.
|
Void |
visitBlock(BlockTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitBreak(BreakTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitCase(CaseTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitCatch(CatchTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitClass(ClassTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitCompilationUnit(CompilationUnitTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitCompoundAssignment(CompoundAssignmentTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitConditionalExpression(ConditionalExpressionTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitContinue(ContinueTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitDoWhileLoop(DoWhileLoopTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitEmptyStatement(EmptyStatementTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitEnhancedForLoop(EnhancedForLoopTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitErroneous(ErroneousTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitExports(ExportsTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitExpressionStatement(ExpressionStatementTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitForLoop(ForLoopTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitIdentifier(IdentifierTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitIf(IfTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitImport(ImportTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitInstanceOf(InstanceOfTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitIntersectionType(IntersectionTypeTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitLabeledStatement(LabeledStatementTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitLambdaExpression(LambdaExpressionTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitLiteral(LiteralTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitMemberReference(MemberReferenceTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitMemberSelect(MemberSelectTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitMethod(MethodTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitMethodInvocation(MethodInvocationTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitModifiers(ModifiersTree arg0,
com.github.javaparser.ast.Node arg1) |
Void |
visitModule(ModuleTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitNewArray(NewArrayTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitNewClass(NewClassTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitOpens(OpensTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitOther(Tree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitPackage(PackageTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitParameterizedType(ParameterizedTypeTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitParenthesized(ParenthesizedTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitPrimitiveType(PrimitiveTypeTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitProvides(ProvidesTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitRequires(RequiresTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitReturn(ReturnTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitSwitch(SwitchTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitSwitchExpression17(Tree tree,
com.github.javaparser.ast.Node node)
Visit a SwitchExpressionTree
|
Void |
visitSynchronized(SynchronizedTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitThrow(ThrowTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitTry(TryTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitTypeCast(TypeCastTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitTypeParameter(TypeParameterTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitUnary(UnaryTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitUnionType(UnionTypeTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitUses(UsesTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitVariable(VariableTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitWhileLoop(WhileLoopTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitWildcard(WildcardTree javacTree,
com.github.javaparser.ast.Node javaParserNode) |
Void |
visitYield17(Tree tree,
com.github.javaparser.ast.Node node)
Visit a YieldTree
|
visit, visit
public Void visitAnnotation(AnnotationTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitAnnotation
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitAnnotation
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitAnnotatedType(AnnotatedTypeTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitAnnotatedType
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitAnnotatedType
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitArrayAccess(ArrayAccessTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitArrayAccess
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitArrayAccess
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitArrayType(ArrayTypeTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitArrayType
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitArrayType
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitAssert(AssertTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitAssert
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitAssert
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitAssignment(AssignmentTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitAssignment
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitAssignment
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitBinary(BinaryTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitBinary
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitBinary
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitBindingPattern17(Tree tree, com.github.javaparser.ast.Node node)
tree
- a BindingPatternTree, typed as Tree to be backward-compatiblenode
- a PatternExpr, typed as Node to be backward-compatiblepublic Void visitBlock(BlockTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitBlock
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitBlock
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public static boolean isDefaultSuperConstructorCall(StatementTree statement)
super()
.statement
- the javac statement to checkpublic Void visitBreak(BreakTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitBreak
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitBreak
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitCase(CaseTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitCase
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitCase
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitCatch(CatchTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitCatch
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitCatch
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitClass(ClassTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitClass
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitClass
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public void visitAnonymousClassBody(ClassTree javacBody, List<com.github.javaparser.ast.body.BodyDeclaration<?>> javaParserMembers)
In normal classes, javac inserts a synthetic no-argument constructor if no constructor is
explicitly defined, which is skipped when visiting members. Anonymous class bodies may
introduce constructors that take arguments if the constructor invocation that created them was
passed arguments. For example, if MyClass
has a constructor taking a single integer
argument, then writing new MyClass(5) { }
expands to the javac tree
new MyClass(5) {
(int arg) {
super(arg);
}
}
This method skips these synthetic constructors.
javacBody
- body of an anonymous class bodyjavaParserMembers
- list of members for the anonymous class body of an ObjectCreationExpr
public static boolean isNoArgumentConstructor(Tree member)
member
is a javac constructor declaration that takes no arguments.member
- the javac tree to checkmember
is a method declaration with name <init>
that takes no
argumentspublic Void visitCompilationUnit(CompilationUnitTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitCompilationUnit
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitCompilationUnit
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitCompoundAssignment(CompoundAssignmentTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitCompoundAssignment
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitCompoundAssignment
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitConditionalExpression(ConditionalExpressionTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitConditionalExpression
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitConditionalExpression
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitContinue(ContinueTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitContinue
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitContinue
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitDoWhileLoop(DoWhileLoopTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitDoWhileLoop
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitDoWhileLoop
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitEmptyStatement(EmptyStatementTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitEmptyStatement
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitEmptyStatement
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitEnhancedForLoop(EnhancedForLoopTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitEnhancedForLoop
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitEnhancedForLoop
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitErroneous(ErroneousTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitErroneous
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitErroneous
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitExports(ExportsTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitExports
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitExports
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitExpressionStatement(ExpressionStatementTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitExpressionStatement
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitExpressionStatement
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitForLoop(ForLoopTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitForLoop
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitForLoop
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitIdentifier(IdentifierTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitIdentifier
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitIdentifier
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitIf(IfTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitIf
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitIf
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitImport(ImportTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitImport
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitImport
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitInstanceOf(InstanceOfTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitInstanceOf
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitInstanceOf
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitIntersectionType(IntersectionTypeTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitIntersectionType
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitIntersectionType
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitLabeledStatement(LabeledStatementTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitLabeledStatement
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitLabeledStatement
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitLambdaExpression(LambdaExpressionTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitLambdaExpression
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitLambdaExpression
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitLiteral(LiteralTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitLiteral
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitLiteral
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitMemberReference(MemberReferenceTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitMemberReference
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitMemberReference
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitMemberSelect(MemberSelectTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitMemberSelect
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitMemberSelect
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitMethod(MethodTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitMethod
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitMethod
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitMethodInvocation(MethodInvocationTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitMethodInvocation
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitMethodInvocation
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitModifiers(ModifiersTree arg0, com.github.javaparser.ast.Node arg1)
visitModifiers
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitModifiers
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitModule(ModuleTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitModule
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitModule
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitNewArray(NewArrayTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitNewArray
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitNewArray
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitNewClass(NewClassTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitNewClass
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitNewClass
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitOpens(OpensTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitOpens
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitOpens
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitOther(Tree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitOther
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitOther
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitPackage(PackageTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitPackage
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitPackage
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitParameterizedType(ParameterizedTypeTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitParameterizedType
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitParameterizedType
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitParenthesized(ParenthesizedTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitParenthesized
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitParenthesized
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitPrimitiveType(PrimitiveTypeTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitPrimitiveType
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitPrimitiveType
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitProvides(ProvidesTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitProvides
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitProvides
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitRequires(RequiresTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitRequires
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitRequires
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitReturn(ReturnTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitReturn
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitReturn
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitSwitch(SwitchTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitSwitch
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitSwitch
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitSwitchExpression17(Tree tree, com.github.javaparser.ast.Node node)
tree
- a SwitchExpressionTree, typed as Tree to be backward-compatiblenode
- a SwitchExpr, typed as Node to be backward-compatiblepublic Void visitSynchronized(SynchronizedTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitSynchronized
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitSynchronized
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitThrow(ThrowTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitThrow
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitThrow
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitTry(TryTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitTry
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitTry
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitTypeCast(TypeCastTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitTypeCast
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitTypeCast
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitTypeParameter(TypeParameterTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitTypeParameter
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitTypeParameter
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitUnary(UnaryTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitUnary
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitUnary
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitUnionType(UnionTypeTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitUnionType
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitUnionType
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitUses(UsesTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitUses
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitUses
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitVariable(VariableTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitVariable
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitVariable
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitWhileLoop(WhileLoopTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitWhileLoop
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitWhileLoop
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitWildcard(WildcardTree javacTree, com.github.javaparser.ast.Node javaParserNode)
visitWildcard
in interface TreeVisitor<Void,com.github.javaparser.ast.Node>
visitWildcard
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
public Void visitYield17(Tree tree, com.github.javaparser.ast.Node node)
tree
- a YieldTree, typed as Tree to be backward-compatiblenode
- a YieldStmt, typed as Node to be backward-compatiblepublic abstract void processAnnotation(AnnotationTree javacTree, com.github.javaparser.ast.expr.NormalAnnotationExpr javaParserNode)
AnnotationTree
with multiple key-value pairs like @MyAnno(a=5,
b=10)
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processAnnotation(AnnotationTree javacTree, com.github.javaparser.ast.expr.MarkerAnnotationExpr javaParserNode)
AnnotationTree
with no arguments like @MyAnno
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processAnnotation(AnnotationTree javacTree, com.github.javaparser.ast.expr.SingleMemberAnnotationExpr javaParserNode)
AnnotationTree
with a single argument like MyAnno(5)
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processAnnotatedType(AnnotatedTypeTree javacTree, com.github.javaparser.ast.Node javaParserNode)
AnnotatedTypeTree
.
In javac, a type with an annotation is represented as an AnnotatedTypeTree
with a
nested tree for the base type whereas in JavaParser the annotations are store directly on the
node for the base type. As a result, the JavaParser base type node will be processed twice,
once with the AnnotatedTypeTree
and once with the tree for the base type.
javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processArrayAccess(ArrayAccessTree javacTree, com.github.javaparser.ast.expr.ArrayAccessExpr javaParserNode)
ArrayAccessTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processArrayType(ArrayTypeTree javacTree, com.github.javaparser.ast.type.ArrayType javaParserNode)
ArrayTypeTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processAssert(AssertTree javacTree, com.github.javaparser.ast.stmt.AssertStmt javaParserNode)
AssertTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processAssignment(AssignmentTree javacTree, com.github.javaparser.ast.expr.AssignExpr javaParserNode)
AssignmentTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processBinary(BinaryTree javacTree, com.github.javaparser.ast.expr.BinaryExpr javaParserNode)
BinaryTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processBlock(BlockTree javacTree, com.github.javaparser.ast.stmt.BlockStmt javaParserNode)
BlockTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processBreak(BreakTree javacTree, com.github.javaparser.ast.stmt.BreakStmt javaParserNode)
BreakTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processCase(CaseTree javacTree, com.github.javaparser.ast.stmt.SwitchEntry javaParserNode)
CaseTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processCatch(CatchTree javacTree, com.github.javaparser.ast.stmt.CatchClause javaParserNode)
CatchTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processClass(ClassTree javacTree, com.github.javaparser.ast.body.AnnotationDeclaration javaParserNode)
ClassTree
representing an annotation declaration.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processClass(ClassTree javacTree, com.github.javaparser.ast.body.ClassOrInterfaceDeclaration javaParserNode)
ClassTree
representing a class or interface declaration.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processClass(ClassTree javacTree, com.github.javaparser.ast.body.RecordDeclaration javaParserNode)
ClassTree
representing a record declaration.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processClass(ClassTree javacTree, com.github.javaparser.ast.body.EnumDeclaration javaParserNode)
ClassTree
representing an enum declaration.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processCompilationUnit(CompilationUnitTree javacTree, com.github.javaparser.ast.CompilationUnit javaParserNode)
CompilationUnitTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processConditionalExpression(ConditionalExpressionTree javacTree, com.github.javaparser.ast.expr.ConditionalExpr javaParserNode)
ConditionalExpressionTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processContinue(ContinueTree javacTree, com.github.javaparser.ast.stmt.ContinueStmt javaParserNode)
ContinueTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processDoWhileLoop(DoWhileLoopTree javacTree, com.github.javaparser.ast.stmt.DoStmt javaParserNode)
DoWhileLoopTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processEmptyStatement(EmptyStatementTree javacTree, com.github.javaparser.ast.stmt.EmptyStmt javaParserNode)
EmptyStatementTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processEnhancedForLoop(EnhancedForLoopTree javacTree, com.github.javaparser.ast.stmt.ForEachStmt javaParserNode)
EnhancedForLoopTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processExports(ExportsTree javacTree, com.github.javaparser.ast.modules.ModuleExportsDirective javaParserNode)
ExportsTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processExpressionStatemen(ExpressionStatementTree javacTree, com.github.javaparser.ast.stmt.ExpressionStmt javaParserNode)
ExpressionStatementTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processForLoop(ForLoopTree javacTree, com.github.javaparser.ast.stmt.ForStmt javaParserNode)
ForLoopTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processIdentifier(IdentifierTree javacTree, com.github.javaparser.ast.type.ClassOrInterfaceType javaParserNode)
IdentifierTree
representing a class or interface type.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processIdentifier(IdentifierTree javacTree, com.github.javaparser.ast.expr.Name javaParserNode)
IdentifierTree
representing a name that may contain dots.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processIdentifier(IdentifierTree javacTree, com.github.javaparser.ast.expr.NameExpr javaParserNode)
IdentifierTree
representing an expression that evaluates to the value of a
variable.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processIdentifier(IdentifierTree javacTree, com.github.javaparser.ast.expr.SimpleName javaParserNode)
IdentifierTree
representing a name without dots.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processIdentifier(IdentifierTree javacTree, com.github.javaparser.ast.expr.SuperExpr javaParserNode)
IdentifierTree
representing a super
expression like the super
in super.myMethod()
or MyClass.super.myMethod()
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processIdentifier(IdentifierTree javacTree, com.github.javaparser.ast.expr.ThisExpr javaParserNode)
IdentifierTree
representing a this
expression like the this
in MyClass = this
, this.myMethod()
, or MyClass.this.myMethod()
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processIf(IfTree javacTree, com.github.javaparser.ast.stmt.IfStmt javaParserNode)
IfTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processImport(ImportTree javacTree, com.github.javaparser.ast.ImportDeclaration javaParserNode)
ImportTree
.
Wildcards are stored differently between the two. In a statement like import a.*;
,
the name is stored as a MemberSelectTree
with a
and *
. In JavaParser
this is just stored as a
but with a method that returns whether it has a wildcard.
javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processInstanceOf(InstanceOfTree javacTree, com.github.javaparser.ast.expr.InstanceOfExpr javaParserNode)
InstanceOfTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processIntersectionType(IntersectionTypeTree javacTree, com.github.javaparser.ast.type.IntersectionType javaParserNode)
IntersectionType
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processLabeledStatement(LabeledStatementTree javacTree, com.github.javaparser.ast.stmt.LabeledStmt javaParserNode)
LabeledStatement
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processLambdaExpression(LambdaExpressionTree javacTree, com.github.javaparser.ast.expr.LambdaExpr javaParserNode)
LambdaExpressionTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processLiteral(LiteralTree javacTree, com.github.javaparser.ast.expr.BinaryExpr javaParserNode)
LiteralTree
for a String literal defined using concatenation.
For an expression like "a" + "b"
, javac stores a single String literal "ab"
but JavaParser stores it as an operation with two operands.
javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processLiteral(LiteralTree javacTree, com.github.javaparser.ast.expr.UnaryExpr javaParserNode)
LiteralTree
for a literal expression prefixed with +
or -
like +5
or -2
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processLiteral(LiteralTree javacTree, com.github.javaparser.ast.expr.LiteralExpr javaParserNode)
LiteralTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processMemberReference(MemberReferenceTree javacTree, com.github.javaparser.ast.expr.MethodReferenceExpr javaParserNode)
MemberReferenceTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processMemberSelect(MemberSelectTree javacTree, com.github.javaparser.ast.expr.ClassExpr javaParserNode)
MemberSelectTree
for a class expression like MyClass.class
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processMemberSelect(MemberSelectTree javacTree, com.github.javaparser.ast.type.ClassOrInterfaceType javaParserNode)
MemberSelectTree
for a type with a name containing dots, like mypackage.MyClass
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processMemberSelect(MemberSelectTree javacTree, com.github.javaparser.ast.expr.FieldAccessExpr javaParserNode)
MemberSelectTree
for a field access expression like myObj.myField
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processMemberSelect(MemberSelectTree javacTree, com.github.javaparser.ast.expr.Name javaParserNode)
MemberSelectTree
for a name that contains dots.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processMemberSelect(MemberSelectTree javacTree, com.github.javaparser.ast.expr.ThisExpr javaParserNode)
MemberSelectTree
for a this expression with a class like MyClass.this
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processMemberSelect(MemberSelectTree javacTree, com.github.javaparser.ast.expr.SuperExpr javaParserNode)
MemberSelectTree
for a super expression with a class like super.MyClass
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processMethod(MethodTree javacTree, com.github.javaparser.ast.body.MethodDeclaration javaParserNode)
MethodTree
representing a regular method declaration.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processMethod(MethodTree javacTree, com.github.javaparser.ast.body.ConstructorDeclaration javaParserNode)
MethodTree
representing a constructor declaration.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processMethod(MethodTree javacTree, com.github.javaparser.ast.body.CompactConstructorDeclaration javaParserNode)
MethodTree
representing a compact constructor declaration.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processMethod(MethodTree javacTree, com.github.javaparser.ast.body.AnnotationMemberDeclaration javaParserNode)
MethodTree
representing a value field for an annotation.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processMethodInvocation(MethodInvocationTree javacTree, com.github.javaparser.ast.stmt.ExplicitConstructorInvocationStmt javaParserNode)
MethodInvocationTree
representing a constructor invocation.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processMethodInvocation(MethodInvocationTree javacTree, com.github.javaparser.ast.expr.MethodCallExpr javaParserNode)
MethodInvocationTree
representing a regular method invocation.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processModule(ModuleTree javacTree, com.github.javaparser.ast.modules.ModuleDeclaration javaParserNode)
ModuleTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processNewClass(NewClassTree javacTree, com.github.javaparser.ast.expr.ObjectCreationExpr javaParserNode)
NewClassTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processOpens(OpensTree javacTree, com.github.javaparser.ast.modules.ModuleOpensDirective javaParserNode)
OpensTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processOther(Tree javacTree, com.github.javaparser.ast.Node javaParserNode)
Tree
that isn't an instance of any specific tree class.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processPackage(PackageTree javacTree, com.github.javaparser.ast.PackageDeclaration javaParserNode)
PackageTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processParameterizedType(ParameterizedTypeTree javacTree, com.github.javaparser.ast.type.ClassOrInterfaceType javaParserNode)
ParameterizedTypeTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processParenthesized(ParenthesizedTree javacTree, com.github.javaparser.ast.expr.EnclosedExpr javaParserNode)
ParenthesizedTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processPrimitiveType(PrimitiveTypeTree javacTree, com.github.javaparser.ast.type.PrimitiveType javaParserNode)
PrimitiveTypeTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processPrimitiveType(PrimitiveTypeTree javacTree, com.github.javaparser.ast.type.VoidType javaParserNode)
PrimitiveTypeTree
representing a void type.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processProvides(ProvidesTree javacTree, com.github.javaparser.ast.modules.ModuleProvidesDirective javaParserNode)
ProvidesTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processRequires(RequiresTree javacTree, com.github.javaparser.ast.modules.ModuleRequiresDirective javaParserNode)
RequiresTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processReturn(ReturnTree javacTree, com.github.javaparser.ast.stmt.ReturnStmt javaParserNode)
RetrunTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processSwitch(SwitchTree javacTree, com.github.javaparser.ast.stmt.SwitchStmt javaParserNode)
SwitchTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processSynchronized(SynchronizedTree javacTree, com.github.javaparser.ast.stmt.SynchronizedStmt javaParserNode)
SynchronizedTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processThrow(ThrowTree javacTree, com.github.javaparser.ast.stmt.ThrowStmt javaParserNode)
ThrowTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processTry(TryTree javacTree, com.github.javaparser.ast.stmt.TryStmt javaParserNode)
TryTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processTypeCast(TypeCastTree javacTree, com.github.javaparser.ast.expr.CastExpr javaParserNode)
TypeCastTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processTypeParameter(TypeParameterTree javacTree, com.github.javaparser.ast.type.TypeParameter javaParserNode)
TypeParameterTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processUnary(UnaryTree javacTree, com.github.javaparser.ast.expr.UnaryExpr javaParserNode)
UnaryTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processUnionType(UnionTypeTree javacTree, com.github.javaparser.ast.type.UnionType javaParserNode)
UnionTypeTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processUses(UsesTree javacTree, com.github.javaparser.ast.modules.ModuleUsesDirective javaParserNode)
UsesTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processVariable(VariableTree javacTree, com.github.javaparser.ast.body.EnumConstantDeclaration javaParserNode)
VariableTree
representing an enum constant declaration. In an enum like
enum MyEnum { MY_CONSTANT }
, javac expands MY_CONSTANT
as a constant variable.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processVariable(VariableTree javacTree, com.github.javaparser.ast.body.Parameter javaParserNode)
VariableTree
representing a parameter to a method or constructor.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processVariable(VariableTree javacTree, com.github.javaparser.ast.body.ReceiverParameter javaParserNode)
VariableTree
representing the receiver parameter of a method.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processVariable(VariableTree javacTree, com.github.javaparser.ast.body.VariableDeclarator javaParserNode)
VariableTree
representing a regular variable declaration.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processWhileLoop(WhileLoopTree javacTree, com.github.javaparser.ast.stmt.WhileStmt javaParserNode)
WhileLoopTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processWildcard(WildcardTree javacTree, com.github.javaparser.ast.type.WildcardType javaParserNode)
WhileLoopTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic abstract void processCompoundAssignment(CompoundAssignmentTree javacTree, com.github.javaparser.ast.expr.AssignExpr javaParserNode)
CompoundAssignmentTree
.javacTree
- tree to processjavaParserNode
- corresponding JavaParser nodepublic <T> T castNode(Class<T> type, com.github.javaparser.ast.Node javaParserNode, Tree javacTree)
javaParserNode
to type type
and return it.T
- the type of type
type
- the type to cast tojavaParserNode
- the object to castjavacTree
- the javac tree that corresponds to javaParserNode
; used only for error
reportingtype
protected Void defaultAction(Tree tree, com.github.javaparser.ast.Node node)
defaultAction
in class SimpleTreeVisitor<Void,com.github.javaparser.ast.Node>
tree
- the Javac treenode
- the Javaparser node