Class JointJavacJavaParserVisitor
- All Implemented Interfaces:
TreeVisitor<Void,
com.github.javaparser.ast.Node>
- Direct Known Subclasses:
DefaultJointVisitor
,JointVisitorWithDefaultAction
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.
-
Field Summary
Fields inherited from class com.sun.source.util.SimpleTreeVisitor
DEFAULT_VALUE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> T
CastjavaParserNode
to typetype
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 callsuper()
.static boolean
isNoArgumentConstructor
(Tree member) Returns whethermember
is a javac constructor declaration that takes no arguments.abstract void
processAnnotatedType
(AnnotatedTypeTree javacTree, com.github.javaparser.ast.Node javaParserNode) Process anAnnotatedTypeTree
.abstract void
processAnnotation
(AnnotationTree javacTree, com.github.javaparser.ast.expr.MarkerAnnotationExpr javaParserNode) Process anAnnotationTree
with no arguments like@MyAnno
.abstract void
processAnnotation
(AnnotationTree javacTree, com.github.javaparser.ast.expr.NormalAnnotationExpr javaParserNode) Process anAnnotationTree
with multiple key-value pairs like@MyAnno(a=5, b=10)
.abstract void
processAnnotation
(AnnotationTree javacTree, com.github.javaparser.ast.expr.SingleMemberAnnotationExpr javaParserNode) Process anAnnotationTree
with a single argument likeMyAnno(5)
.abstract void
processArrayAccess
(ArrayAccessTree javacTree, com.github.javaparser.ast.expr.ArrayAccessExpr javaParserNode) Process anArrayAccessTree
.abstract void
processArrayType
(ArrayTypeTree javacTree, com.github.javaparser.ast.type.ArrayType javaParserNode) Process anArrayTypeTree
.abstract void
processAssert
(AssertTree javacTree, com.github.javaparser.ast.stmt.AssertStmt javaParserNode) Process anAssertTree
.abstract void
processAssignment
(AssignmentTree javacTree, com.github.javaparser.ast.expr.AssignExpr javaParserNode) Process anAssignmentTree
.abstract void
processBinary
(BinaryTree javacTree, com.github.javaparser.ast.expr.BinaryExpr javaParserNode) Process aBinaryTree
.abstract void
processBindingPattern
(Tree javacTree, com.github.javaparser.ast.expr.PatternExpr javaParserNode) Process aBindingPatternTree
.abstract void
processBlock
(BlockTree javacTree, com.github.javaparser.ast.stmt.BlockStmt javaParserNode) Process aBlockTree
.abstract void
processBreak
(BreakTree javacTree, com.github.javaparser.ast.stmt.BreakStmt javaParserNode) Process aBreakTree
.abstract void
processCase
(CaseTree javacTree, com.github.javaparser.ast.stmt.SwitchEntry javaParserNode) Process aCaseTree
.abstract void
processCatch
(CatchTree javacTree, com.github.javaparser.ast.stmt.CatchClause javaParserNode) Process aCatchTree
.abstract void
processClass
(ClassTree javacTree, com.github.javaparser.ast.body.AnnotationDeclaration javaParserNode) Process aClassTree
representing an annotation declaration.abstract void
processClass
(ClassTree javacTree, com.github.javaparser.ast.body.ClassOrInterfaceDeclaration javaParserNode) Process aClassTree
representing a class or interface declaration.abstract void
processClass
(ClassTree javacTree, com.github.javaparser.ast.body.EnumDeclaration javaParserNode) Process aClassTree
representing an enum declaration.abstract void
processClass
(ClassTree javacTree, com.github.javaparser.ast.body.RecordDeclaration javaParserNode) Process aClassTree
representing a record declaration.abstract void
processCompilationUnit
(CompilationUnitTree javacTree, com.github.javaparser.ast.CompilationUnit javaParserNode) Process aCompilationUnitTree
.abstract void
processCompoundAssignment
(CompoundAssignmentTree javacTree, com.github.javaparser.ast.expr.AssignExpr javaParserNode) Process aCompoundAssignmentTree
.abstract void
processConditionalExpression
(ConditionalExpressionTree javacTree, com.github.javaparser.ast.expr.ConditionalExpr javaParserNode) Process aConditionalExpressionTree
.abstract void
processContinue
(ContinueTree javacTree, com.github.javaparser.ast.stmt.ContinueStmt javaParserNode) Process aContinueTree
.abstract void
processDoWhileLoop
(DoWhileLoopTree javacTree, com.github.javaparser.ast.stmt.DoStmt javaParserNode) Process aDoWhileLoopTree
.abstract void
processEmptyStatement
(EmptyStatementTree javacTree, com.github.javaparser.ast.stmt.EmptyStmt javaParserNode) Process anEmptyStatementTree
.abstract void
processEnhancedForLoop
(EnhancedForLoopTree javacTree, com.github.javaparser.ast.stmt.ForEachStmt javaParserNode) Process anEnhancedForLoopTree
.abstract void
processExports
(ExportsTree javacTree, com.github.javaparser.ast.modules.ModuleExportsDirective javaParserNode) Process anExportsTree
.abstract void
processExpressionStatemen
(ExpressionStatementTree javacTree, com.github.javaparser.ast.stmt.ExpressionStmt javaParserNode) Process anExpressionStatementTree
.abstract void
processForLoop
(ForLoopTree javacTree, com.github.javaparser.ast.stmt.ForStmt javaParserNode) Process aForLoopTree
.abstract void
processIdentifier
(IdentifierTree javacTree, com.github.javaparser.ast.expr.Name javaParserNode) Process anIdentifierTree
representing a name that may contain dots.abstract void
processIdentifier
(IdentifierTree javacTree, com.github.javaparser.ast.expr.NameExpr javaParserNode) Process anIdentifierTree
representing an expression that evaluates to the value of a variable.abstract void
processIdentifier
(IdentifierTree javacTree, com.github.javaparser.ast.expr.SimpleName javaParserNode) Process anIdentifierTree
representing a name without dots.abstract void
processIdentifier
(IdentifierTree javacTree, com.github.javaparser.ast.expr.SuperExpr javaParserNode) Process anIdentifierTree
representing asuper
expression like thesuper
insuper.myMethod()
orMyClass.super.myMethod()
.abstract void
processIdentifier
(IdentifierTree javacTree, com.github.javaparser.ast.expr.ThisExpr javaParserNode) Process anIdentifierTree
representing athis
expression like thethis
inMyClass = this
,this.myMethod()
, orMyClass.this.myMethod()
.abstract void
processIdentifier
(IdentifierTree javacTree, com.github.javaparser.ast.type.ClassOrInterfaceType javaParserNode) Process anIdentifierTree
representing a class or interface type.abstract void
Process anIfTree
.abstract void
processImport
(ImportTree javacTree, com.github.javaparser.ast.ImportDeclaration javaParserNode) Process anImportTree
.abstract void
processInstanceOf
(InstanceOfTree javacTree, com.github.javaparser.ast.expr.InstanceOfExpr javaParserNode) Process anInstanceOfTree
.abstract void
processIntersectionType
(IntersectionTypeTree javacTree, com.github.javaparser.ast.type.IntersectionType javaParserNode) Process anIntersectionType
.abstract void
processLabeledStatement
(LabeledStatementTree javacTree, com.github.javaparser.ast.stmt.LabeledStmt javaParserNode) Process aLabeledStatement
.abstract void
processLambdaExpression
(LambdaExpressionTree javacTree, com.github.javaparser.ast.expr.LambdaExpr javaParserNode) Process aLambdaExpressionTree
.abstract void
processLiteral
(LiteralTree javacTree, com.github.javaparser.ast.expr.BinaryExpr javaParserNode) Process aLiteralTree
for a String literal defined using concatenation.abstract void
processLiteral
(LiteralTree javacTree, com.github.javaparser.ast.expr.LiteralExpr javaParserNode) Process aLiteralTree
.abstract void
processLiteral
(LiteralTree javacTree, com.github.javaparser.ast.expr.UnaryExpr javaParserNode) Process aLiteralTree
for a literal expression prefixed with+
or-
like+5
or-2
.abstract void
processMemberReference
(MemberReferenceTree javacTree, com.github.javaparser.ast.expr.MethodReferenceExpr javaParserNode) Process aMemberReferenceTree
.abstract void
processMemberSelect
(MemberSelectTree javacTree, com.github.javaparser.ast.expr.ClassExpr javaParserNode) Process aMemberSelectTree
for a class expression likeMyClass.class
.abstract void
processMemberSelect
(MemberSelectTree javacTree, com.github.javaparser.ast.expr.FieldAccessExpr javaParserNode) Process aMemberSelectTree
for a field access expression likemyObj.myField
.abstract void
processMemberSelect
(MemberSelectTree javacTree, com.github.javaparser.ast.expr.Name javaParserNode) Process aMemberSelectTree
for a name that contains dots.abstract void
processMemberSelect
(MemberSelectTree javacTree, com.github.javaparser.ast.expr.SuperExpr javaParserNode) Process aMemberSelectTree
for a super expression with a class likesuper.MyClass
.abstract void
processMemberSelect
(MemberSelectTree javacTree, com.github.javaparser.ast.expr.ThisExpr javaParserNode) Process aMemberSelectTree
for a this expression with a class likeMyClass.this
.abstract void
processMemberSelect
(MemberSelectTree javacTree, com.github.javaparser.ast.type.ClassOrInterfaceType javaParserNode) Process aMemberSelectTree
for a type with a name containing dots, likemypackage.MyClass
.abstract void
processMethod
(MethodTree javacTree, com.github.javaparser.ast.body.AnnotationMemberDeclaration javaParserNode) Process aMethodTree
representing a value field for an annotation.abstract void
processMethod
(MethodTree javacTree, com.github.javaparser.ast.body.CompactConstructorDeclaration javaParserNode) Process aMethodTree
representing a compact constructor declaration.abstract void
processMethod
(MethodTree javacTree, com.github.javaparser.ast.body.ConstructorDeclaration javaParserNode) Process aMethodTree
representing a constructor declaration.abstract void
processMethod
(MethodTree javacTree, com.github.javaparser.ast.body.MethodDeclaration javaParserNode) Process aMethodTree
representing a regular method declaration.abstract void
processMethodInvocation
(MethodInvocationTree javacTree, com.github.javaparser.ast.expr.MethodCallExpr javaParserNode) Process aMethodInvocationTree
representing a regular method invocation.abstract void
processMethodInvocation
(MethodInvocationTree javacTree, com.github.javaparser.ast.stmt.ExplicitConstructorInvocationStmt javaParserNode) Process aMethodInvocationTree
representing a constructor invocation.abstract void
processModule
(ModuleTree javacTree, com.github.javaparser.ast.modules.ModuleDeclaration javaParserNode) Process aModuleTree
.abstract void
processNewClass
(NewClassTree javacTree, com.github.javaparser.ast.expr.ObjectCreationExpr javaParserNode) Process aNewClassTree
.abstract void
processOpens
(OpensTree javacTree, com.github.javaparser.ast.modules.ModuleOpensDirective javaParserNode) Process anOpensTree
.abstract void
processOther
(Tree javacTree, com.github.javaparser.ast.Node javaParserNode) Process aTree
that isn't an instance of any specific tree class.abstract void
processPackage
(PackageTree javacTree, com.github.javaparser.ast.PackageDeclaration javaParserNode) Process aPackageTree
.abstract void
processParameterizedType
(ParameterizedTypeTree javacTree, com.github.javaparser.ast.type.ClassOrInterfaceType javaParserNode) Process aParameterizedTypeTree
.abstract void
processParenthesized
(ParenthesizedTree javacTree, com.github.javaparser.ast.expr.EnclosedExpr javaParserNode) Process aParenthesizedTree
.abstract void
processPrimitiveType
(PrimitiveTypeTree javacTree, com.github.javaparser.ast.type.PrimitiveType javaParserNode) Process aPrimitiveTypeTree
.abstract void
processPrimitiveType
(PrimitiveTypeTree javacTree, com.github.javaparser.ast.type.VoidType javaParserNode) Process aPrimitiveTypeTree
representing a void type.abstract void
processProvides
(ProvidesTree javacTree, com.github.javaparser.ast.modules.ModuleProvidesDirective javaParserNode) Process aProvidesTree
.abstract void
processRequires
(RequiresTree javacTree, com.github.javaparser.ast.modules.ModuleRequiresDirective javaParserNode) Process aRequiresTree
.abstract void
processReturn
(ReturnTree javacTree, com.github.javaparser.ast.stmt.ReturnStmt javaParserNode) Process aRetrunTree
.abstract void
processSwitch
(SwitchTree javacTree, com.github.javaparser.ast.stmt.SwitchStmt javaParserNode) Process aSwitchTree
.abstract void
processSwitchExpression
(Tree javacTree, com.github.javaparser.ast.expr.SwitchExpr javaParserNode) Process aSwitchExpressionTree
.abstract void
processSynchronized
(SynchronizedTree javacTree, com.github.javaparser.ast.stmt.SynchronizedStmt javaParserNode) Process aSynchronizedTree
.abstract void
processThrow
(ThrowTree javacTree, com.github.javaparser.ast.stmt.ThrowStmt javaParserNode) Process aThrowTree
.abstract void
processTry
(TryTree javacTree, com.github.javaparser.ast.stmt.TryStmt javaParserNode) Process aTryTree
.abstract void
processTypeCast
(TypeCastTree javacTree, com.github.javaparser.ast.expr.CastExpr javaParserNode) Process aTypeCastTree
.abstract void
processTypeParameter
(TypeParameterTree javacTree, com.github.javaparser.ast.type.TypeParameter javaParserNode) Process aTypeParameterTree
.abstract void
processUnary
(UnaryTree javacTree, com.github.javaparser.ast.expr.UnaryExpr javaParserNode) Process aUnaryTree
.abstract void
processUnionType
(UnionTypeTree javacTree, com.github.javaparser.ast.type.UnionType javaParserNode) Process aUnionTypeTree
.abstract void
processUses
(UsesTree javacTree, com.github.javaparser.ast.modules.ModuleUsesDirective javaParserNode) Process aUsesTree
.abstract void
processVariable
(VariableTree javacTree, com.github.javaparser.ast.body.EnumConstantDeclaration javaParserNode) Process aVariableTree
representing an enum constant declaration.abstract void
processVariable
(VariableTree javacTree, com.github.javaparser.ast.body.Parameter javaParserNode) Process aVariableTree
representing a parameter to a method or constructor.abstract void
processVariable
(VariableTree javacTree, com.github.javaparser.ast.body.ReceiverParameter javaParserNode) Process aVariableTree
representing the receiver parameter of a method.abstract void
processVariable
(VariableTree javacTree, com.github.javaparser.ast.body.VariableDeclarator javaParserNode) Process aVariableTree
representing a regular variable declaration.abstract void
processWhileLoop
(WhileLoopTree javacTree, com.github.javaparser.ast.stmt.WhileStmt javaParserNode) Process aWhileLoopTree
.abstract void
processWildcard
(WildcardTree javacTree, com.github.javaparser.ast.type.WildcardType javaParserNode) Process aWhileLoopTree
.abstract void
processYield
(Tree javacTree, com.github.javaparser.ast.stmt.YieldStmt javaParserNode) Process aYieldTree
.visitAnnotatedType
(AnnotatedTypeTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitAnnotation
(AnnotationTree javacTree, com.github.javaparser.ast.Node javaParserNode) void
visitAnonymousClassBody
(ClassTree javacBody, List<com.github.javaparser.ast.body.BodyDeclaration<?>> javaParserMembers) Visits the members of an anonymous class body.visitArrayAccess
(ArrayAccessTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitArrayType
(ArrayTypeTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitAssert
(AssertTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitAssignment
(AssignmentTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitBinary
(BinaryTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitBindingPattern17
(Tree javacTree, com.github.javaparser.ast.Node javaParserNode) Visit a BindingPatternTree.visitBlock
(BlockTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitBreak
(BreakTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitCatch
(CatchTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitClass
(ClassTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitCompilationUnit
(CompilationUnitTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitCompoundAssignment
(CompoundAssignmentTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitConditionalExpression
(ConditionalExpressionTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitContinue
(ContinueTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitDoWhileLoop
(DoWhileLoopTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitEmptyStatement
(EmptyStatementTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitEnhancedForLoop
(EnhancedForLoopTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitErroneous
(ErroneousTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitExports
(ExportsTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitExpressionStatement
(ExpressionStatementTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitForLoop
(ForLoopTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitIdentifier
(IdentifierTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitImport
(ImportTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitInstanceOf
(InstanceOfTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitIntersectionType
(IntersectionTypeTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitLabeledStatement
(LabeledStatementTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitLambdaExpression
(LambdaExpressionTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitLiteral
(LiteralTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitMemberReference
(MemberReferenceTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitMemberSelect
(MemberSelectTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitMethod
(MethodTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitMethodInvocation
(MethodInvocationTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitModifiers
(ModifiersTree arg0, com.github.javaparser.ast.Node arg1) visitModule
(ModuleTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitNewArray
(NewArrayTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitNewClass
(NewClassTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitOpens
(OpensTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitOther
(Tree javacTree, com.github.javaparser.ast.Node javaParserNode) visitPackage
(PackageTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitParameterizedType
(ParameterizedTypeTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitParenthesized
(ParenthesizedTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitPrimitiveType
(PrimitiveTypeTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitProvides
(ProvidesTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitRequires
(RequiresTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitReturn
(ReturnTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitSwitch
(SwitchTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitSwitchExpression17
(Tree javacTree, com.github.javaparser.ast.Node javaParserNode) Visit a switch expression.visitSynchronized
(SynchronizedTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitThrow
(ThrowTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitTypeCast
(TypeCastTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitTypeParameter
(TypeParameterTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitUnary
(UnaryTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitUnionType
(UnionTypeTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitVariable
(VariableTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitWhileLoop
(WhileLoopTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitWildcard
(WildcardTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitYield17
(Tree tree, com.github.javaparser.ast.Node node) Visit a YieldTreeMethods inherited from class com.sun.source.util.SimpleTreeVisitor
visit, visit, visitBindingPattern, visitDefaultCaseLabel, visitGuardedPattern, visitParenthesizedPattern, visitSwitchExpression, visitYield
-
Constructor Details
-
JointJavacJavaParserVisitor
public JointJavacJavaParserVisitor()
-
-
Method Details
-
visitAnnotation
public Void visitAnnotation(AnnotationTree javacTree, com.github.javaparser.ast.Node javaParserNode) - Specified by:
visitAnnotation
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitAnnotation
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitAnnotatedType
public Void visitAnnotatedType(AnnotatedTypeTree javacTree, com.github.javaparser.ast.Node javaParserNode) - Specified by:
visitAnnotatedType
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitAnnotatedType
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitArrayAccess
public Void visitArrayAccess(ArrayAccessTree javacTree, com.github.javaparser.ast.Node javaParserNode) - Specified by:
visitArrayAccess
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitArrayAccess
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitArrayType
- Specified by:
visitArrayType
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitArrayType
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitAssert
- Specified by:
visitAssert
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitAssert
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitAssignment
public Void visitAssignment(AssignmentTree javacTree, com.github.javaparser.ast.Node javaParserNode) - Specified by:
visitAssignment
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitAssignment
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitBinary
- Specified by:
visitBinary
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitBinary
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitBindingPattern17
Visit a BindingPatternTree.- Parameters:
javacTree
- a BindingPatternTree, typed as Tree to be backward-compatiblejavaParserNode
- a PatternExpr- Returns:
- nothing
-
visitBlock
- Specified by:
visitBlock
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitBlock
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
isDefaultSuperConstructorCall
Returns whether a javac statement represents a method callsuper()
.- Parameters:
statement
- the javac statement to check- Returns:
- true if statement is a method invocation named "super" with no arguments, false otherwise
-
visitBreak
- Specified by:
visitBreak
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitBreak
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitCase
- Specified by:
visitCase
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitCase
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitCatch
- Specified by:
visitCatch
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitCatch
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitClass
- Specified by:
visitClass
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitClass
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitAnonymousClassBody
public void visitAnonymousClassBody(ClassTree javacBody, List<com.github.javaparser.ast.body.BodyDeclaration<?>> javaParserMembers) Visits the members of an anonymous class body.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 writingnew MyClass(5) { }
expands to the javac treenew MyClass(5) { (int arg) { super(arg); } }
This method skips these synthetic constructors.
- Parameters:
javacBody
- body of an anonymous class bodyjavaParserMembers
- list of members for the anonymous class body of anObjectCreationExpr
-
isNoArgumentConstructor
Returns whethermember
is a javac constructor declaration that takes no arguments.- Parameters:
member
- the javac tree to check- Returns:
- true if
member
is a method declaration with name<init>
that takes no arguments
-
visitCompilationUnit
public Void visitCompilationUnit(CompilationUnitTree javacTree, com.github.javaparser.ast.Node javaParserNode) - Specified by:
visitCompilationUnit
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitCompilationUnit
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitCompoundAssignment
public Void visitCompoundAssignment(CompoundAssignmentTree javacTree, com.github.javaparser.ast.Node javaParserNode) - Specified by:
visitCompoundAssignment
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitCompoundAssignment
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitConditionalExpression
public Void visitConditionalExpression(ConditionalExpressionTree javacTree, com.github.javaparser.ast.Node javaParserNode) - Specified by:
visitConditionalExpression
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitConditionalExpression
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitContinue
- Specified by:
visitContinue
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitContinue
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitDoWhileLoop
public Void visitDoWhileLoop(DoWhileLoopTree javacTree, com.github.javaparser.ast.Node javaParserNode) - Specified by:
visitDoWhileLoop
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitDoWhileLoop
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitEmptyStatement
public Void visitEmptyStatement(EmptyStatementTree javacTree, com.github.javaparser.ast.Node javaParserNode) - Specified by:
visitEmptyStatement
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitEmptyStatement
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitEnhancedForLoop
public Void visitEnhancedForLoop(EnhancedForLoopTree javacTree, com.github.javaparser.ast.Node javaParserNode) - Specified by:
visitEnhancedForLoop
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitEnhancedForLoop
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitErroneous
- Specified by:
visitErroneous
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitErroneous
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitExports
- Specified by:
visitExports
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitExports
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitExpressionStatement
public Void visitExpressionStatement(ExpressionStatementTree javacTree, com.github.javaparser.ast.Node javaParserNode) - Specified by:
visitExpressionStatement
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitExpressionStatement
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitForLoop
- Specified by:
visitForLoop
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitForLoop
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitIdentifier
public Void visitIdentifier(IdentifierTree javacTree, com.github.javaparser.ast.Node javaParserNode) - Specified by:
visitIdentifier
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitIdentifier
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitIf
- Specified by:
visitIf
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitIf
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitImport
- Specified by:
visitImport
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitImport
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitInstanceOf
public Void visitInstanceOf(InstanceOfTree javacTree, com.github.javaparser.ast.Node javaParserNode) - Specified by:
visitInstanceOf
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitInstanceOf
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitIntersectionType
public Void visitIntersectionType(IntersectionTypeTree javacTree, com.github.javaparser.ast.Node javaParserNode) - Specified by:
visitIntersectionType
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitIntersectionType
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitLabeledStatement
public Void visitLabeledStatement(LabeledStatementTree javacTree, com.github.javaparser.ast.Node javaParserNode) - Specified by:
visitLabeledStatement
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitLabeledStatement
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitLambdaExpression
public Void visitLambdaExpression(LambdaExpressionTree javacTree, com.github.javaparser.ast.Node javaParserNode) - Specified by:
visitLambdaExpression
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitLambdaExpression
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitLiteral
- Specified by:
visitLiteral
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitLiteral
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitMemberReference
public Void visitMemberReference(MemberReferenceTree javacTree, com.github.javaparser.ast.Node javaParserNode) - Specified by:
visitMemberReference
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitMemberReference
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitMemberSelect
public Void visitMemberSelect(MemberSelectTree javacTree, com.github.javaparser.ast.Node javaParserNode) - Specified by:
visitMemberSelect
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitMemberSelect
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitMethod
- Specified by:
visitMethod
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitMethod
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitMethodInvocation
public Void visitMethodInvocation(MethodInvocationTree javacTree, com.github.javaparser.ast.Node javaParserNode) - Specified by:
visitMethodInvocation
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitMethodInvocation
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitModifiers
- Specified by:
visitModifiers
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitModifiers
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitModule
- Specified by:
visitModule
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitModule
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitNewArray
- Specified by:
visitNewArray
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitNewArray
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitNewClass
- Specified by:
visitNewClass
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitNewClass
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitOpens
- Specified by:
visitOpens
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitOpens
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitOther
- Specified by:
visitOther
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitOther
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitPackage
- Specified by:
visitPackage
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitPackage
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitParameterizedType
public Void visitParameterizedType(ParameterizedTypeTree javacTree, com.github.javaparser.ast.Node javaParserNode) - Specified by:
visitParameterizedType
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitParameterizedType
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitParenthesized
public Void visitParenthesized(ParenthesizedTree javacTree, com.github.javaparser.ast.Node javaParserNode) - Specified by:
visitParenthesized
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitParenthesized
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitPrimitiveType
public Void visitPrimitiveType(PrimitiveTypeTree javacTree, com.github.javaparser.ast.Node javaParserNode) - Specified by:
visitPrimitiveType
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitPrimitiveType
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitProvides
- Specified by:
visitProvides
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitProvides
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitRequires
- Specified by:
visitRequires
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitRequires
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitReturn
- Specified by:
visitReturn
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitReturn
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitSwitch
- Specified by:
visitSwitch
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitSwitch
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitSwitchExpression17
Visit a switch expression.- Parameters:
javacTree
- switch expression treejavaParserNode
- a JavaParser node- Returns:
- null
-
visitSynchronized
public Void visitSynchronized(SynchronizedTree javacTree, com.github.javaparser.ast.Node javaParserNode) - Specified by:
visitSynchronized
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitSynchronized
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitThrow
- Specified by:
visitThrow
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitThrow
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitTry
- Specified by:
visitTry
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitTry
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitTypeCast
- Specified by:
visitTypeCast
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitTypeCast
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitTypeParameter
public Void visitTypeParameter(TypeParameterTree javacTree, com.github.javaparser.ast.Node javaParserNode) - Specified by:
visitTypeParameter
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitTypeParameter
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitUnary
- Specified by:
visitUnary
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitUnary
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitUnionType
- Specified by:
visitUnionType
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitUnionType
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitUses
- Specified by:
visitUses
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitUses
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitVariable
- Specified by:
visitVariable
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitVariable
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitWhileLoop
- Specified by:
visitWhileLoop
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitWhileLoop
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitWildcard
- Specified by:
visitWildcard
in interfaceTreeVisitor<Void,
com.github.javaparser.ast.Node> - Overrides:
visitWildcard
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node>
-
visitYield17
Visit a YieldTree- Parameters:
tree
- a YieldTree, typed as Tree to be backward-compatiblenode
- a YieldStmt, typed as Node to be backward-compatible- Returns:
- nothing
-
processAnnotation
public abstract void processAnnotation(AnnotationTree javacTree, com.github.javaparser.ast.expr.NormalAnnotationExpr javaParserNode) Process anAnnotationTree
with multiple key-value pairs like@MyAnno(a=5, b=10)
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processAnnotation
public abstract void processAnnotation(AnnotationTree javacTree, com.github.javaparser.ast.expr.MarkerAnnotationExpr javaParserNode) Process anAnnotationTree
with no arguments like@MyAnno
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processAnnotation
public abstract void processAnnotation(AnnotationTree javacTree, com.github.javaparser.ast.expr.SingleMemberAnnotationExpr javaParserNode) Process anAnnotationTree
with a single argument likeMyAnno(5)
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processAnnotatedType
public abstract void processAnnotatedType(AnnotatedTypeTree javacTree, com.github.javaparser.ast.Node javaParserNode) Process anAnnotatedTypeTree
.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 theAnnotatedTypeTree
and once with the tree for the base type.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processArrayAccess
public abstract void processArrayAccess(ArrayAccessTree javacTree, com.github.javaparser.ast.expr.ArrayAccessExpr javaParserNode) Process anArrayAccessTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processArrayType
public abstract void processArrayType(ArrayTypeTree javacTree, com.github.javaparser.ast.type.ArrayType javaParserNode) Process anArrayTypeTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processAssert
public abstract void processAssert(AssertTree javacTree, com.github.javaparser.ast.stmt.AssertStmt javaParserNode) Process anAssertTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processAssignment
public abstract void processAssignment(AssignmentTree javacTree, com.github.javaparser.ast.expr.AssignExpr javaParserNode) Process anAssignmentTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processBinary
public abstract void processBinary(BinaryTree javacTree, com.github.javaparser.ast.expr.BinaryExpr javaParserNode) Process aBinaryTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processBindingPattern
public abstract void processBindingPattern(Tree javacTree, com.github.javaparser.ast.expr.PatternExpr javaParserNode) Process aBindingPatternTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processBlock
public abstract void processBlock(BlockTree javacTree, com.github.javaparser.ast.stmt.BlockStmt javaParserNode) Process aBlockTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processBreak
public abstract void processBreak(BreakTree javacTree, com.github.javaparser.ast.stmt.BreakStmt javaParserNode) Process aBreakTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processCase
public abstract void processCase(CaseTree javacTree, com.github.javaparser.ast.stmt.SwitchEntry javaParserNode) Process aCaseTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processCatch
public abstract void processCatch(CatchTree javacTree, com.github.javaparser.ast.stmt.CatchClause javaParserNode) Process aCatchTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processClass
public abstract void processClass(ClassTree javacTree, com.github.javaparser.ast.body.AnnotationDeclaration javaParserNode) Process aClassTree
representing an annotation declaration.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processClass
public abstract void processClass(ClassTree javacTree, com.github.javaparser.ast.body.ClassOrInterfaceDeclaration javaParserNode) Process aClassTree
representing a class or interface declaration.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processClass
public abstract void processClass(ClassTree javacTree, com.github.javaparser.ast.body.RecordDeclaration javaParserNode) Process aClassTree
representing a record declaration.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processClass
public abstract void processClass(ClassTree javacTree, com.github.javaparser.ast.body.EnumDeclaration javaParserNode) Process aClassTree
representing an enum declaration.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processCompilationUnit
public abstract void processCompilationUnit(CompilationUnitTree javacTree, com.github.javaparser.ast.CompilationUnit javaParserNode) Process aCompilationUnitTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processConditionalExpression
public abstract void processConditionalExpression(ConditionalExpressionTree javacTree, com.github.javaparser.ast.expr.ConditionalExpr javaParserNode) Process aConditionalExpressionTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processContinue
public abstract void processContinue(ContinueTree javacTree, com.github.javaparser.ast.stmt.ContinueStmt javaParserNode) Process aContinueTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processDoWhileLoop
public abstract void processDoWhileLoop(DoWhileLoopTree javacTree, com.github.javaparser.ast.stmt.DoStmt javaParserNode) Process aDoWhileLoopTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processEmptyStatement
public abstract void processEmptyStatement(EmptyStatementTree javacTree, com.github.javaparser.ast.stmt.EmptyStmt javaParserNode) Process anEmptyStatementTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processEnhancedForLoop
public abstract void processEnhancedForLoop(EnhancedForLoopTree javacTree, com.github.javaparser.ast.stmt.ForEachStmt javaParserNode) Process anEnhancedForLoopTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processExports
public abstract void processExports(ExportsTree javacTree, com.github.javaparser.ast.modules.ModuleExportsDirective javaParserNode) Process anExportsTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processExpressionStatemen
public abstract void processExpressionStatemen(ExpressionStatementTree javacTree, com.github.javaparser.ast.stmt.ExpressionStmt javaParserNode) Process anExpressionStatementTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processForLoop
public abstract void processForLoop(ForLoopTree javacTree, com.github.javaparser.ast.stmt.ForStmt javaParserNode) Process aForLoopTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processIdentifier
public abstract void processIdentifier(IdentifierTree javacTree, com.github.javaparser.ast.type.ClassOrInterfaceType javaParserNode) Process anIdentifierTree
representing a class or interface type.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processIdentifier
public abstract void processIdentifier(IdentifierTree javacTree, com.github.javaparser.ast.expr.Name javaParserNode) Process anIdentifierTree
representing a name that may contain dots.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processIdentifier
public abstract void processIdentifier(IdentifierTree javacTree, com.github.javaparser.ast.expr.NameExpr javaParserNode) Process anIdentifierTree
representing an expression that evaluates to the value of a variable.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processIdentifier
public abstract void processIdentifier(IdentifierTree javacTree, com.github.javaparser.ast.expr.SimpleName javaParserNode) Process anIdentifierTree
representing a name without dots.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processIdentifier
public abstract void processIdentifier(IdentifierTree javacTree, com.github.javaparser.ast.expr.SuperExpr javaParserNode) Process anIdentifierTree
representing asuper
expression like thesuper
insuper.myMethod()
orMyClass.super.myMethod()
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processIdentifier
public abstract void processIdentifier(IdentifierTree javacTree, com.github.javaparser.ast.expr.ThisExpr javaParserNode) Process anIdentifierTree
representing athis
expression like thethis
inMyClass = this
,this.myMethod()
, orMyClass.this.myMethod()
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processIf
public abstract void processIf(IfTree javacTree, com.github.javaparser.ast.stmt.IfStmt javaParserNode) Process anIfTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processImport
public abstract void processImport(ImportTree javacTree, com.github.javaparser.ast.ImportDeclaration javaParserNode) Process anImportTree
.Wildcards are stored differently between the two. In a statement like
import a.*;
, the name is stored as aMemberSelectTree
witha
and*
. In JavaParser this is just stored asa
but with a method that returns whether it has a wildcard.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processInstanceOf
public abstract void processInstanceOf(InstanceOfTree javacTree, com.github.javaparser.ast.expr.InstanceOfExpr javaParserNode) Process anInstanceOfTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processIntersectionType
public abstract void processIntersectionType(IntersectionTypeTree javacTree, com.github.javaparser.ast.type.IntersectionType javaParserNode) Process anIntersectionType
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processLabeledStatement
public abstract void processLabeledStatement(LabeledStatementTree javacTree, com.github.javaparser.ast.stmt.LabeledStmt javaParserNode) Process aLabeledStatement
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processLambdaExpression
public abstract void processLambdaExpression(LambdaExpressionTree javacTree, com.github.javaparser.ast.expr.LambdaExpr javaParserNode) Process aLambdaExpressionTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processLiteral
public abstract void processLiteral(LiteralTree javacTree, com.github.javaparser.ast.expr.BinaryExpr javaParserNode) Process aLiteralTree
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.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processLiteral
public abstract void processLiteral(LiteralTree javacTree, com.github.javaparser.ast.expr.UnaryExpr javaParserNode) Process aLiteralTree
for a literal expression prefixed with+
or-
like+5
or-2
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processLiteral
public abstract void processLiteral(LiteralTree javacTree, com.github.javaparser.ast.expr.LiteralExpr javaParserNode) Process aLiteralTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processMemberReference
public abstract void processMemberReference(MemberReferenceTree javacTree, com.github.javaparser.ast.expr.MethodReferenceExpr javaParserNode) Process aMemberReferenceTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processMemberSelect
public abstract void processMemberSelect(MemberSelectTree javacTree, com.github.javaparser.ast.expr.ClassExpr javaParserNode) Process aMemberSelectTree
for a class expression likeMyClass.class
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processMemberSelect
public abstract void processMemberSelect(MemberSelectTree javacTree, com.github.javaparser.ast.type.ClassOrInterfaceType javaParserNode) Process aMemberSelectTree
for a type with a name containing dots, likemypackage.MyClass
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processMemberSelect
public abstract void processMemberSelect(MemberSelectTree javacTree, com.github.javaparser.ast.expr.FieldAccessExpr javaParserNode) Process aMemberSelectTree
for a field access expression likemyObj.myField
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processMemberSelect
public abstract void processMemberSelect(MemberSelectTree javacTree, com.github.javaparser.ast.expr.Name javaParserNode) Process aMemberSelectTree
for a name that contains dots.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processMemberSelect
public abstract void processMemberSelect(MemberSelectTree javacTree, com.github.javaparser.ast.expr.ThisExpr javaParserNode) Process aMemberSelectTree
for a this expression with a class likeMyClass.this
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processMemberSelect
public abstract void processMemberSelect(MemberSelectTree javacTree, com.github.javaparser.ast.expr.SuperExpr javaParserNode) Process aMemberSelectTree
for a super expression with a class likesuper.MyClass
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processMethod
public abstract void processMethod(MethodTree javacTree, com.github.javaparser.ast.body.MethodDeclaration javaParserNode) Process aMethodTree
representing a regular method declaration.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processMethod
public abstract void processMethod(MethodTree javacTree, com.github.javaparser.ast.body.ConstructorDeclaration javaParserNode) Process aMethodTree
representing a constructor declaration.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processMethod
public abstract void processMethod(MethodTree javacTree, com.github.javaparser.ast.body.CompactConstructorDeclaration javaParserNode) Process aMethodTree
representing a compact constructor declaration.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processMethod
public abstract void processMethod(MethodTree javacTree, com.github.javaparser.ast.body.AnnotationMemberDeclaration javaParserNode) Process aMethodTree
representing a value field for an annotation.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processMethodInvocation
public abstract void processMethodInvocation(MethodInvocationTree javacTree, com.github.javaparser.ast.stmt.ExplicitConstructorInvocationStmt javaParserNode) Process aMethodInvocationTree
representing a constructor invocation.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processMethodInvocation
public abstract void processMethodInvocation(MethodInvocationTree javacTree, com.github.javaparser.ast.expr.MethodCallExpr javaParserNode) Process aMethodInvocationTree
representing a regular method invocation.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processModule
public abstract void processModule(ModuleTree javacTree, com.github.javaparser.ast.modules.ModuleDeclaration javaParserNode) Process aModuleTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processNewClass
public abstract void processNewClass(NewClassTree javacTree, com.github.javaparser.ast.expr.ObjectCreationExpr javaParserNode) Process aNewClassTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processOpens
public abstract void processOpens(OpensTree javacTree, com.github.javaparser.ast.modules.ModuleOpensDirective javaParserNode) Process anOpensTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processOther
Process aTree
that isn't an instance of any specific tree class.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processPackage
public abstract void processPackage(PackageTree javacTree, com.github.javaparser.ast.PackageDeclaration javaParserNode) Process aPackageTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processParameterizedType
public abstract void processParameterizedType(ParameterizedTypeTree javacTree, com.github.javaparser.ast.type.ClassOrInterfaceType javaParserNode) Process aParameterizedTypeTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processParenthesized
public abstract void processParenthesized(ParenthesizedTree javacTree, com.github.javaparser.ast.expr.EnclosedExpr javaParserNode) Process aParenthesizedTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processPrimitiveType
public abstract void processPrimitiveType(PrimitiveTypeTree javacTree, com.github.javaparser.ast.type.PrimitiveType javaParserNode) Process aPrimitiveTypeTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processPrimitiveType
public abstract void processPrimitiveType(PrimitiveTypeTree javacTree, com.github.javaparser.ast.type.VoidType javaParserNode) Process aPrimitiveTypeTree
representing a void type.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processProvides
public abstract void processProvides(ProvidesTree javacTree, com.github.javaparser.ast.modules.ModuleProvidesDirective javaParserNode) Process aProvidesTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processRequires
public abstract void processRequires(RequiresTree javacTree, com.github.javaparser.ast.modules.ModuleRequiresDirective javaParserNode) Process aRequiresTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processReturn
public abstract void processReturn(ReturnTree javacTree, com.github.javaparser.ast.stmt.ReturnStmt javaParserNode) Process aRetrunTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processSwitch
public abstract void processSwitch(SwitchTree javacTree, com.github.javaparser.ast.stmt.SwitchStmt javaParserNode) Process aSwitchTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processSwitchExpression
public abstract void processSwitchExpression(Tree javacTree, com.github.javaparser.ast.expr.SwitchExpr javaParserNode) Process aSwitchExpressionTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processSynchronized
public abstract void processSynchronized(SynchronizedTree javacTree, com.github.javaparser.ast.stmt.SynchronizedStmt javaParserNode) Process aSynchronizedTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processThrow
public abstract void processThrow(ThrowTree javacTree, com.github.javaparser.ast.stmt.ThrowStmt javaParserNode) Process aThrowTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processTry
public abstract void processTry(TryTree javacTree, com.github.javaparser.ast.stmt.TryStmt javaParserNode) Process aTryTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processTypeCast
public abstract void processTypeCast(TypeCastTree javacTree, com.github.javaparser.ast.expr.CastExpr javaParserNode) Process aTypeCastTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processTypeParameter
public abstract void processTypeParameter(TypeParameterTree javacTree, com.github.javaparser.ast.type.TypeParameter javaParserNode) Process aTypeParameterTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processUnary
public abstract void processUnary(UnaryTree javacTree, com.github.javaparser.ast.expr.UnaryExpr javaParserNode) Process aUnaryTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processUnionType
public abstract void processUnionType(UnionTypeTree javacTree, com.github.javaparser.ast.type.UnionType javaParserNode) Process aUnionTypeTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processUses
public abstract void processUses(UsesTree javacTree, com.github.javaparser.ast.modules.ModuleUsesDirective javaParserNode) Process aUsesTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processVariable
public abstract void processVariable(VariableTree javacTree, com.github.javaparser.ast.body.EnumConstantDeclaration javaParserNode) Process aVariableTree
representing an enum constant declaration. In an enum likeenum MyEnum { MY_CONSTANT }
, javac expandsMY_CONSTANT
as a constant variable.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processVariable
public abstract void processVariable(VariableTree javacTree, com.github.javaparser.ast.body.Parameter javaParserNode) Process aVariableTree
representing a parameter to a method or constructor.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processVariable
public abstract void processVariable(VariableTree javacTree, com.github.javaparser.ast.body.ReceiverParameter javaParserNode) Process aVariableTree
representing the receiver parameter of a method.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processVariable
public abstract void processVariable(VariableTree javacTree, com.github.javaparser.ast.body.VariableDeclarator javaParserNode) Process aVariableTree
representing a regular variable declaration.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processWhileLoop
public abstract void processWhileLoop(WhileLoopTree javacTree, com.github.javaparser.ast.stmt.WhileStmt javaParserNode) Process aWhileLoopTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processWildcard
public abstract void processWildcard(WildcardTree javacTree, com.github.javaparser.ast.type.WildcardType javaParserNode) Process aWhileLoopTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processYield
public abstract void processYield(Tree javacTree, com.github.javaparser.ast.stmt.YieldStmt javaParserNode) Process aYieldTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding Javaparser node
-
processCompoundAssignment
public abstract void processCompoundAssignment(CompoundAssignmentTree javacTree, com.github.javaparser.ast.expr.AssignExpr javaParserNode) Process aCompoundAssignmentTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
castNode
CastjavaParserNode
to typetype
and return it.- Type Parameters:
T
- the type oftype
- Parameters:
type
- the type to cast tojavaParserNode
- the object to castjavacTree
- the javac tree that corresponds tojavaParserNode
; used only for error reporting- Returns:
- javaParserNode, casted to
type
-
defaultAction
The default action for this visitor. This is inherited from SimpleTreeVisitor, but is only called for those methods which do not have an override of the visitXXX method in this class. Ultimately, those are the methods added post Java 11, such as for switch-expressions.- Overrides:
defaultAction
in classSimpleTreeVisitor<Void,
com.github.javaparser.ast.Node> - Parameters:
tree
- the Javac treenode
- the Javaparser node- Returns:
- nothing
-