Class JointJavacJavaParserVisitor
- All Implemented Interfaces:
com.sun.source.tree.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
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> T
castNode
(Class<T> type, com.github.javaparser.ast.Node javaParserNode, com.sun.source.tree.Tree javacTree) CastjavaParserNode
to typetype
and return it.protected Void
defaultAction
(com.sun.source.tree.Tree tree, com.github.javaparser.ast.Node node) The default action for this visitor.static boolean
isDefaultSuperConstructorCall
(com.sun.source.tree.StatementTree statement) Returns whether a javac statement represents a method callsuper()
.static boolean
isNoArgumentConstructor
(com.sun.source.tree.Tree member) Returns whethermember
is a javac constructor declaration that takes no arguments.abstract void
processAnnotatedType
(com.sun.source.tree.AnnotatedTypeTree javacTree, com.github.javaparser.ast.Node javaParserNode) Process anAnnotatedTypeTree
.abstract void
processAnnotation
(com.sun.source.tree.AnnotationTree javacTree, com.github.javaparser.ast.expr.MarkerAnnotationExpr javaParserNode) Process anAnnotationTree
with no arguments like@MyAnno
.abstract void
processAnnotation
(com.sun.source.tree.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
(com.sun.source.tree.AnnotationTree javacTree, com.github.javaparser.ast.expr.SingleMemberAnnotationExpr javaParserNode) Process anAnnotationTree
with a single argument likeMyAnno(5)
.abstract void
processArrayAccess
(com.sun.source.tree.ArrayAccessTree javacTree, com.github.javaparser.ast.expr.ArrayAccessExpr javaParserNode) Process anArrayAccessTree
.abstract void
processArrayType
(com.sun.source.tree.ArrayTypeTree javacTree, com.github.javaparser.ast.type.ArrayType javaParserNode) Process anArrayTypeTree
.abstract void
processAssert
(com.sun.source.tree.AssertTree javacTree, com.github.javaparser.ast.stmt.AssertStmt javaParserNode) Process anAssertTree
.abstract void
processAssignment
(com.sun.source.tree.AssignmentTree javacTree, com.github.javaparser.ast.expr.AssignExpr javaParserNode) Process anAssignmentTree
.abstract void
processBinary
(com.sun.source.tree.BinaryTree javacTree, com.github.javaparser.ast.expr.BinaryExpr javaParserNode) Process aBinaryTree
.abstract void
processBindingPattern
(com.sun.source.tree.Tree javacTree, com.github.javaparser.ast.expr.PatternExpr javaParserNode) Process aBindingPatternTree
.abstract void
processBlock
(com.sun.source.tree.BlockTree javacTree, com.github.javaparser.ast.stmt.BlockStmt javaParserNode) Process aBlockTree
.abstract void
processBreak
(com.sun.source.tree.BreakTree javacTree, com.github.javaparser.ast.stmt.BreakStmt javaParserNode) Process aBreakTree
.abstract void
processCase
(com.sun.source.tree.CaseTree javacTree, com.github.javaparser.ast.stmt.SwitchEntry javaParserNode) Process aCaseTree
.abstract void
processCatch
(com.sun.source.tree.CatchTree javacTree, com.github.javaparser.ast.stmt.CatchClause javaParserNode) Process aCatchTree
.abstract void
processClass
(com.sun.source.tree.ClassTree javacTree, com.github.javaparser.ast.body.AnnotationDeclaration javaParserNode) Process aClassTree
representing an annotation declaration.abstract void
processClass
(com.sun.source.tree.ClassTree javacTree, com.github.javaparser.ast.body.ClassOrInterfaceDeclaration javaParserNode) Process aClassTree
representing a class or interface declaration.abstract void
processClass
(com.sun.source.tree.ClassTree javacTree, com.github.javaparser.ast.body.EnumDeclaration javaParserNode) Process aClassTree
representing an enum declaration.abstract void
processClass
(com.sun.source.tree.ClassTree javacTree, com.github.javaparser.ast.body.RecordDeclaration javaParserNode) Process aClassTree
representing a record declaration.abstract void
processCompilationUnit
(com.sun.source.tree.CompilationUnitTree javacTree, com.github.javaparser.ast.CompilationUnit javaParserNode) Process aCompilationUnitTree
.abstract void
processCompoundAssignment
(com.sun.source.tree.CompoundAssignmentTree javacTree, com.github.javaparser.ast.expr.AssignExpr javaParserNode) Process aCompoundAssignmentTree
.abstract void
processConditionalExpression
(com.sun.source.tree.ConditionalExpressionTree javacTree, com.github.javaparser.ast.expr.ConditionalExpr javaParserNode) Process aConditionalExpressionTree
.abstract void
processContinue
(com.sun.source.tree.ContinueTree javacTree, com.github.javaparser.ast.stmt.ContinueStmt javaParserNode) Process aContinueTree
.abstract void
processDoWhileLoop
(com.sun.source.tree.DoWhileLoopTree javacTree, com.github.javaparser.ast.stmt.DoStmt javaParserNode) Process aDoWhileLoopTree
.abstract void
processEmptyStatement
(com.sun.source.tree.EmptyStatementTree javacTree, com.github.javaparser.ast.stmt.EmptyStmt javaParserNode) Process anEmptyStatementTree
.abstract void
processEnhancedForLoop
(com.sun.source.tree.EnhancedForLoopTree javacTree, com.github.javaparser.ast.stmt.ForEachStmt javaParserNode) Process anEnhancedForLoopTree
.abstract void
processExports
(com.sun.source.tree.ExportsTree javacTree, com.github.javaparser.ast.modules.ModuleExportsDirective javaParserNode) Process anExportsTree
.abstract void
processExpressionStatemen
(com.sun.source.tree.ExpressionStatementTree javacTree, com.github.javaparser.ast.stmt.ExpressionStmt javaParserNode) Process anExpressionStatementTree
.abstract void
processForLoop
(com.sun.source.tree.ForLoopTree javacTree, com.github.javaparser.ast.stmt.ForStmt javaParserNode) Process aForLoopTree
.abstract void
processIdentifier
(com.sun.source.tree.IdentifierTree javacTree, com.github.javaparser.ast.expr.Name javaParserNode) Process anIdentifierTree
representing a name that may contain dots.abstract void
processIdentifier
(com.sun.source.tree.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
(com.sun.source.tree.IdentifierTree javacTree, com.github.javaparser.ast.expr.SimpleName javaParserNode) Process anIdentifierTree
representing a name without dots.abstract void
processIdentifier
(com.sun.source.tree.IdentifierTree javacTree, com.github.javaparser.ast.expr.SuperExpr javaParserNode) Process anIdentifierTree
representing asuper
expression like thesuper
insuper.myMethod()
orMyClass.super.myMethod()
.abstract void
processIdentifier
(com.sun.source.tree.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
(com.sun.source.tree.IdentifierTree javacTree, com.github.javaparser.ast.type.ClassOrInterfaceType javaParserNode) Process anIdentifierTree
representing a class or interface type.abstract void
processIf
(com.sun.source.tree.IfTree javacTree, com.github.javaparser.ast.stmt.IfStmt javaParserNode) Process anIfTree
.abstract void
processImport
(com.sun.source.tree.ImportTree javacTree, com.github.javaparser.ast.ImportDeclaration javaParserNode) Process anImportTree
.abstract void
processInstanceOf
(com.sun.source.tree.InstanceOfTree javacTree, com.github.javaparser.ast.expr.InstanceOfExpr javaParserNode) Process anInstanceOfTree
.abstract void
processIntersectionType
(com.sun.source.tree.IntersectionTypeTree javacTree, com.github.javaparser.ast.type.IntersectionType javaParserNode) Process anIntersectionType
.abstract void
processLabeledStatement
(com.sun.source.tree.LabeledStatementTree javacTree, com.github.javaparser.ast.stmt.LabeledStmt javaParserNode) Process aLabeledStatement
.abstract void
processLambdaExpression
(com.sun.source.tree.LambdaExpressionTree javacTree, com.github.javaparser.ast.expr.LambdaExpr javaParserNode) Process aLambdaExpressionTree
.abstract void
processLiteral
(com.sun.source.tree.LiteralTree javacTree, com.github.javaparser.ast.expr.BinaryExpr javaParserNode) Process aLiteralTree
for a String literal defined using concatenation.abstract void
processLiteral
(com.sun.source.tree.LiteralTree javacTree, com.github.javaparser.ast.expr.LiteralExpr javaParserNode) Process aLiteralTree
.abstract void
processLiteral
(com.sun.source.tree.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
(com.sun.source.tree.MemberReferenceTree javacTree, com.github.javaparser.ast.expr.MethodReferenceExpr javaParserNode) Process aMemberReferenceTree
.abstract void
processMemberSelect
(com.sun.source.tree.MemberSelectTree javacTree, com.github.javaparser.ast.expr.ClassExpr javaParserNode) Process aMemberSelectTree
for a class expression likeMyClass.class
.abstract void
processMemberSelect
(com.sun.source.tree.MemberSelectTree javacTree, com.github.javaparser.ast.expr.FieldAccessExpr javaParserNode) Process aMemberSelectTree
for a field access expression likemyObj.myField
.abstract void
processMemberSelect
(com.sun.source.tree.MemberSelectTree javacTree, com.github.javaparser.ast.expr.Name javaParserNode) Process aMemberSelectTree
for a name that contains dots.abstract void
processMemberSelect
(com.sun.source.tree.MemberSelectTree javacTree, com.github.javaparser.ast.expr.SuperExpr javaParserNode) Process aMemberSelectTree
for a super expression with a class likesuper.MyClass
.abstract void
processMemberSelect
(com.sun.source.tree.MemberSelectTree javacTree, com.github.javaparser.ast.expr.ThisExpr javaParserNode) Process aMemberSelectTree
for a this expression with a class likeMyClass.this
.abstract void
processMemberSelect
(com.sun.source.tree.MemberSelectTree javacTree, com.github.javaparser.ast.type.ClassOrInterfaceType javaParserNode) Process aMemberSelectTree
for a type with a name containing dots, likemypackage.MyClass
.abstract void
processMethod
(com.sun.source.tree.MethodTree javacTree, com.github.javaparser.ast.body.AnnotationMemberDeclaration javaParserNode) Process aMethodTree
representing a value field for an annotation.abstract void
processMethod
(com.sun.source.tree.MethodTree javacTree, com.github.javaparser.ast.body.CompactConstructorDeclaration javaParserNode) Process aMethodTree
representing a compact constructor declaration.abstract void
processMethod
(com.sun.source.tree.MethodTree javacTree, com.github.javaparser.ast.body.ConstructorDeclaration javaParserNode) Process aMethodTree
representing a constructor declaration.abstract void
processMethod
(com.sun.source.tree.MethodTree javacTree, com.github.javaparser.ast.body.MethodDeclaration javaParserNode) Process aMethodTree
representing a regular method declaration.abstract void
processMethodInvocation
(com.sun.source.tree.MethodInvocationTree javacTree, com.github.javaparser.ast.expr.MethodCallExpr javaParserNode) Process aMethodInvocationTree
representing a regular method invocation.abstract void
processMethodInvocation
(com.sun.source.tree.MethodInvocationTree javacTree, com.github.javaparser.ast.stmt.ExplicitConstructorInvocationStmt javaParserNode) Process aMethodInvocationTree
representing a constructor invocation.abstract void
processModule
(com.sun.source.tree.ModuleTree javacTree, com.github.javaparser.ast.modules.ModuleDeclaration javaParserNode) Process aModuleTree
.abstract void
processNewClass
(com.sun.source.tree.NewClassTree javacTree, com.github.javaparser.ast.expr.ObjectCreationExpr javaParserNode) Process aNewClassTree
.abstract void
processOpens
(com.sun.source.tree.OpensTree javacTree, com.github.javaparser.ast.modules.ModuleOpensDirective javaParserNode) Process anOpensTree
.abstract void
processOther
(com.sun.source.tree.Tree javacTree, com.github.javaparser.ast.Node javaParserNode) Process aTree
that isn't an instance of any specific tree class.abstract void
processPackage
(com.sun.source.tree.PackageTree javacTree, com.github.javaparser.ast.PackageDeclaration javaParserNode) Process aPackageTree
.abstract void
processParameterizedType
(com.sun.source.tree.ParameterizedTypeTree javacTree, com.github.javaparser.ast.type.ClassOrInterfaceType javaParserNode) Process aParameterizedTypeTree
.abstract void
processParenthesized
(com.sun.source.tree.ParenthesizedTree javacTree, com.github.javaparser.ast.expr.EnclosedExpr javaParserNode) Process aParenthesizedTree
.abstract void
processPrimitiveType
(com.sun.source.tree.PrimitiveTypeTree javacTree, com.github.javaparser.ast.type.PrimitiveType javaParserNode) Process aPrimitiveTypeTree
.abstract void
processPrimitiveType
(com.sun.source.tree.PrimitiveTypeTree javacTree, com.github.javaparser.ast.type.VoidType javaParserNode) Process aPrimitiveTypeTree
representing a void type.abstract void
processProvides
(com.sun.source.tree.ProvidesTree javacTree, com.github.javaparser.ast.modules.ModuleProvidesDirective javaParserNode) Process aProvidesTree
.abstract void
processRequires
(com.sun.source.tree.RequiresTree javacTree, com.github.javaparser.ast.modules.ModuleRequiresDirective javaParserNode) Process aRequiresTree
.abstract void
processReturn
(com.sun.source.tree.ReturnTree javacTree, com.github.javaparser.ast.stmt.ReturnStmt javaParserNode) Process aRetrunTree
.abstract void
processSwitch
(com.sun.source.tree.SwitchTree javacTree, com.github.javaparser.ast.stmt.SwitchStmt javaParserNode) Process aSwitchTree
.abstract void
processSwitchExpression
(com.sun.source.tree.Tree javacTree, com.github.javaparser.ast.expr.SwitchExpr javaParserNode) Process aSwitchExpressionTree
.abstract void
processSynchronized
(com.sun.source.tree.SynchronizedTree javacTree, com.github.javaparser.ast.stmt.SynchronizedStmt javaParserNode) Process aSynchronizedTree
.abstract void
processThrow
(com.sun.source.tree.ThrowTree javacTree, com.github.javaparser.ast.stmt.ThrowStmt javaParserNode) Process aThrowTree
.abstract void
processTry
(com.sun.source.tree.TryTree javacTree, com.github.javaparser.ast.stmt.TryStmt javaParserNode) Process aTryTree
.abstract void
processTypeCast
(com.sun.source.tree.TypeCastTree javacTree, com.github.javaparser.ast.expr.CastExpr javaParserNode) Process aTypeCastTree
.abstract void
processTypeParameter
(com.sun.source.tree.TypeParameterTree javacTree, com.github.javaparser.ast.type.TypeParameter javaParserNode) Process aTypeParameterTree
.abstract void
processUnary
(com.sun.source.tree.UnaryTree javacTree, com.github.javaparser.ast.expr.UnaryExpr javaParserNode) Process aUnaryTree
.abstract void
processUnionType
(com.sun.source.tree.UnionTypeTree javacTree, com.github.javaparser.ast.type.UnionType javaParserNode) Process aUnionTypeTree
.abstract void
processUses
(com.sun.source.tree.UsesTree javacTree, com.github.javaparser.ast.modules.ModuleUsesDirective javaParserNode) Process aUsesTree
.abstract void
processVariable
(com.sun.source.tree.VariableTree javacTree, com.github.javaparser.ast.body.EnumConstantDeclaration javaParserNode) Process aVariableTree
representing an enum constant declaration.abstract void
processVariable
(com.sun.source.tree.VariableTree javacTree, com.github.javaparser.ast.body.Parameter javaParserNode) Process aVariableTree
representing a parameter to a method or constructor.abstract void
processVariable
(com.sun.source.tree.VariableTree javacTree, com.github.javaparser.ast.body.ReceiverParameter javaParserNode) Process aVariableTree
representing the receiver parameter of a method.abstract void
processVariable
(com.sun.source.tree.VariableTree javacTree, com.github.javaparser.ast.body.VariableDeclarator javaParserNode) Process aVariableTree
representing a regular variable declaration.abstract void
processWhileLoop
(com.sun.source.tree.WhileLoopTree javacTree, com.github.javaparser.ast.stmt.WhileStmt javaParserNode) Process aWhileLoopTree
.abstract void
processWildcard
(com.sun.source.tree.WildcardTree javacTree, com.github.javaparser.ast.type.WildcardType javaParserNode) Process aWhileLoopTree
.abstract void
processYield
(com.sun.source.tree.Tree javacTree, com.github.javaparser.ast.stmt.YieldStmt javaParserNode) Process aYieldTree
.visitAnnotatedType
(com.sun.source.tree.AnnotatedTypeTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitAnnotation
(com.sun.source.tree.AnnotationTree javacTree, com.github.javaparser.ast.Node javaParserNode) void
visitAnonymousClassBody
(com.sun.source.tree.ClassTree javacBody, List<com.github.javaparser.ast.body.BodyDeclaration<?>> javaParserMembers) Visits the members of an anonymous class body.visitArrayAccess
(com.sun.source.tree.ArrayAccessTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitArrayType
(com.sun.source.tree.ArrayTypeTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitAssert
(com.sun.source.tree.AssertTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitAssignment
(com.sun.source.tree.AssignmentTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitBinary
(com.sun.source.tree.BinaryTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitBindingPattern17
(com.sun.source.tree.Tree javacTree, com.github.javaparser.ast.Node javaParserNode) Visit a BindingPatternTree.visitBlock
(com.sun.source.tree.BlockTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitBreak
(com.sun.source.tree.BreakTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitCase
(com.sun.source.tree.CaseTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitCatch
(com.sun.source.tree.CatchTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitClass
(com.sun.source.tree.ClassTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitCompilationUnit
(com.sun.source.tree.CompilationUnitTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitCompoundAssignment
(com.sun.source.tree.CompoundAssignmentTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitConditionalExpression
(com.sun.source.tree.ConditionalExpressionTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitContinue
(com.sun.source.tree.ContinueTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitDoWhileLoop
(com.sun.source.tree.DoWhileLoopTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitEmptyStatement
(com.sun.source.tree.EmptyStatementTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitEnhancedForLoop
(com.sun.source.tree.EnhancedForLoopTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitErroneous
(com.sun.source.tree.ErroneousTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitExports
(com.sun.source.tree.ExportsTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitExpressionStatement
(com.sun.source.tree.ExpressionStatementTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitForLoop
(com.sun.source.tree.ForLoopTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitIdentifier
(com.sun.source.tree.IdentifierTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitIf
(com.sun.source.tree.IfTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitImport
(com.sun.source.tree.ImportTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitInstanceOf
(com.sun.source.tree.InstanceOfTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitIntersectionType
(com.sun.source.tree.IntersectionTypeTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitLabeledStatement
(com.sun.source.tree.LabeledStatementTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitLambdaExpression
(com.sun.source.tree.LambdaExpressionTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitLiteral
(com.sun.source.tree.LiteralTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitMemberReference
(com.sun.source.tree.MemberReferenceTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitMemberSelect
(com.sun.source.tree.MemberSelectTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitMethod
(com.sun.source.tree.MethodTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitMethodInvocation
(com.sun.source.tree.MethodInvocationTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitModifiers
(com.sun.source.tree.ModifiersTree arg0, com.github.javaparser.ast.Node arg1) visitModule
(com.sun.source.tree.ModuleTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitNewArray
(com.sun.source.tree.NewArrayTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitNewClass
(com.sun.source.tree.NewClassTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitOpens
(com.sun.source.tree.OpensTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitOther
(com.sun.source.tree.Tree javacTree, com.github.javaparser.ast.Node javaParserNode) visitPackage
(com.sun.source.tree.PackageTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitParameterizedType
(com.sun.source.tree.ParameterizedTypeTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitParenthesized
(com.sun.source.tree.ParenthesizedTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitPrimitiveType
(com.sun.source.tree.PrimitiveTypeTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitProvides
(com.sun.source.tree.ProvidesTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitRequires
(com.sun.source.tree.RequiresTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitReturn
(com.sun.source.tree.ReturnTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitSwitch
(com.sun.source.tree.SwitchTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitSwitchExpression17
(com.sun.source.tree.Tree javacTree, com.github.javaparser.ast.Node javaParserNode) Visit a switch expression.visitSynchronized
(com.sun.source.tree.SynchronizedTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitThrow
(com.sun.source.tree.ThrowTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitTry
(com.sun.source.tree.TryTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitTypeCast
(com.sun.source.tree.TypeCastTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitTypeParameter
(com.sun.source.tree.TypeParameterTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitUnary
(com.sun.source.tree.UnaryTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitUnionType
(com.sun.source.tree.UnionTypeTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitUses
(com.sun.source.tree.UsesTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitVariable
(com.sun.source.tree.VariableTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitWhileLoop
(com.sun.source.tree.WhileLoopTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitWildcard
(com.sun.source.tree.WildcardTree javacTree, com.github.javaparser.ast.Node javaParserNode) visitYield17
(com.sun.source.tree.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(com.sun.source.tree.AnnotationTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitAnnotatedType
public Void visitAnnotatedType(com.sun.source.tree.AnnotatedTypeTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitArrayAccess
public Void visitArrayAccess(com.sun.source.tree.ArrayAccessTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitArrayType
public Void visitArrayType(com.sun.source.tree.ArrayTypeTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitAssert
public Void visitAssert(com.sun.source.tree.AssertTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitAssignment
public Void visitAssignment(com.sun.source.tree.AssignmentTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitBinary
public Void visitBinary(com.sun.source.tree.BinaryTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitBindingPattern17
public Void visitBindingPattern17(com.sun.source.tree.Tree javacTree, com.github.javaparser.ast.Node javaParserNode) Visit a BindingPatternTree.- Parameters:
javacTree
- a BindingPatternTree, typed as Tree to be backward-compatiblejavaParserNode
- a PatternExpr- Returns:
- nothing
-
visitBlock
public Void visitBlock(com.sun.source.tree.BlockTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
isDefaultSuperConstructorCall
public static boolean isDefaultSuperConstructorCall(com.sun.source.tree.StatementTree statement) 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
public Void visitBreak(com.sun.source.tree.BreakTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitCase
public Void visitCase(com.sun.source.tree.CaseTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitCatch
public Void visitCatch(com.sun.source.tree.CatchTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitClass
public Void visitClass(com.sun.source.tree.ClassTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitAnonymousClassBody
public void visitAnonymousClassBody(com.sun.source.tree.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
public static boolean isNoArgumentConstructor(com.sun.source.tree.Tree member) 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(com.sun.source.tree.CompilationUnitTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitCompoundAssignment
public Void visitCompoundAssignment(com.sun.source.tree.CompoundAssignmentTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitConditionalExpression
public Void visitConditionalExpression(com.sun.source.tree.ConditionalExpressionTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitContinue
public Void visitContinue(com.sun.source.tree.ContinueTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitDoWhileLoop
public Void visitDoWhileLoop(com.sun.source.tree.DoWhileLoopTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitEmptyStatement
public Void visitEmptyStatement(com.sun.source.tree.EmptyStatementTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitEnhancedForLoop
public Void visitEnhancedForLoop(com.sun.source.tree.EnhancedForLoopTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitErroneous
public Void visitErroneous(com.sun.source.tree.ErroneousTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitExports
public Void visitExports(com.sun.source.tree.ExportsTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitExpressionStatement
public Void visitExpressionStatement(com.sun.source.tree.ExpressionStatementTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitForLoop
public Void visitForLoop(com.sun.source.tree.ForLoopTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitIdentifier
public Void visitIdentifier(com.sun.source.tree.IdentifierTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitIf
public Void visitIf(com.sun.source.tree.IfTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitImport
public Void visitImport(com.sun.source.tree.ImportTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitInstanceOf
public Void visitInstanceOf(com.sun.source.tree.InstanceOfTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitIntersectionType
public Void visitIntersectionType(com.sun.source.tree.IntersectionTypeTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitLabeledStatement
public Void visitLabeledStatement(com.sun.source.tree.LabeledStatementTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitLambdaExpression
public Void visitLambdaExpression(com.sun.source.tree.LambdaExpressionTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitLiteral
public Void visitLiteral(com.sun.source.tree.LiteralTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitMemberReference
public Void visitMemberReference(com.sun.source.tree.MemberReferenceTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitMemberSelect
public Void visitMemberSelect(com.sun.source.tree.MemberSelectTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitMethod
public Void visitMethod(com.sun.source.tree.MethodTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitMethodInvocation
public Void visitMethodInvocation(com.sun.source.tree.MethodInvocationTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitModifiers
public Void visitModifiers(com.sun.source.tree.ModifiersTree arg0, com.github.javaparser.ast.Node arg1) -
visitModule
public Void visitModule(com.sun.source.tree.ModuleTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitNewArray
public Void visitNewArray(com.sun.source.tree.NewArrayTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitNewClass
public Void visitNewClass(com.sun.source.tree.NewClassTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitOpens
public Void visitOpens(com.sun.source.tree.OpensTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitOther
public Void visitOther(com.sun.source.tree.Tree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitPackage
public Void visitPackage(com.sun.source.tree.PackageTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitParameterizedType
public Void visitParameterizedType(com.sun.source.tree.ParameterizedTypeTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitParenthesized
public Void visitParenthesized(com.sun.source.tree.ParenthesizedTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitPrimitiveType
public Void visitPrimitiveType(com.sun.source.tree.PrimitiveTypeTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitProvides
public Void visitProvides(com.sun.source.tree.ProvidesTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitRequires
public Void visitRequires(com.sun.source.tree.RequiresTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitReturn
public Void visitReturn(com.sun.source.tree.ReturnTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitSwitch
public Void visitSwitch(com.sun.source.tree.SwitchTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitSwitchExpression17
public Void visitSwitchExpression17(com.sun.source.tree.Tree javacTree, com.github.javaparser.ast.Node javaParserNode) Visit a switch expression.- Parameters:
javacTree
- switch expression treejavaParserNode
- java parser node- Returns:
- null
-
visitSynchronized
public Void visitSynchronized(com.sun.source.tree.SynchronizedTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitThrow
public Void visitThrow(com.sun.source.tree.ThrowTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitTry
public Void visitTry(com.sun.source.tree.TryTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitTypeCast
public Void visitTypeCast(com.sun.source.tree.TypeCastTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitTypeParameter
public Void visitTypeParameter(com.sun.source.tree.TypeParameterTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitUnary
public Void visitUnary(com.sun.source.tree.UnaryTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitUnionType
public Void visitUnionType(com.sun.source.tree.UnionTypeTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitUses
public Void visitUses(com.sun.source.tree.UsesTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitVariable
public Void visitVariable(com.sun.source.tree.VariableTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitWhileLoop
public Void visitWhileLoop(com.sun.source.tree.WhileLoopTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
visitWildcard
public Void visitWildcard(com.sun.source.tree.WildcardTree javacTree, com.github.javaparser.ast.Node javaParserNode) -
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(com.sun.source.tree.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(com.sun.source.tree.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(com.sun.source.tree.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(com.sun.source.tree.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(com.sun.source.tree.ArrayAccessTree javacTree, com.github.javaparser.ast.expr.ArrayAccessExpr javaParserNode) Process anArrayAccessTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processArrayType
public abstract void processArrayType(com.sun.source.tree.ArrayTypeTree javacTree, com.github.javaparser.ast.type.ArrayType javaParserNode) Process anArrayTypeTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processAssert
public abstract void processAssert(com.sun.source.tree.AssertTree javacTree, com.github.javaparser.ast.stmt.AssertStmt javaParserNode) Process anAssertTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processAssignment
public abstract void processAssignment(com.sun.source.tree.AssignmentTree javacTree, com.github.javaparser.ast.expr.AssignExpr javaParserNode) Process anAssignmentTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processBinary
public abstract void processBinary(com.sun.source.tree.BinaryTree javacTree, com.github.javaparser.ast.expr.BinaryExpr javaParserNode) Process aBinaryTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processBindingPattern
public abstract void processBindingPattern(com.sun.source.tree.Tree javacTree, com.github.javaparser.ast.expr.PatternExpr javaParserNode) Process aBindingPatternTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processBlock
public abstract void processBlock(com.sun.source.tree.BlockTree javacTree, com.github.javaparser.ast.stmt.BlockStmt javaParserNode) Process aBlockTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processBreak
public abstract void processBreak(com.sun.source.tree.BreakTree javacTree, com.github.javaparser.ast.stmt.BreakStmt javaParserNode) Process aBreakTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processCase
public abstract void processCase(com.sun.source.tree.CaseTree javacTree, com.github.javaparser.ast.stmt.SwitchEntry javaParserNode) Process aCaseTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processCatch
public abstract void processCatch(com.sun.source.tree.CatchTree javacTree, com.github.javaparser.ast.stmt.CatchClause javaParserNode) Process aCatchTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processClass
public abstract void processClass(com.sun.source.tree.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(com.sun.source.tree.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(com.sun.source.tree.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(com.sun.source.tree.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(com.sun.source.tree.CompilationUnitTree javacTree, com.github.javaparser.ast.CompilationUnit javaParserNode) Process aCompilationUnitTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processConditionalExpression
public abstract void processConditionalExpression(com.sun.source.tree.ConditionalExpressionTree javacTree, com.github.javaparser.ast.expr.ConditionalExpr javaParserNode) Process aConditionalExpressionTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processContinue
public abstract void processContinue(com.sun.source.tree.ContinueTree javacTree, com.github.javaparser.ast.stmt.ContinueStmt javaParserNode) Process aContinueTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processDoWhileLoop
public abstract void processDoWhileLoop(com.sun.source.tree.DoWhileLoopTree javacTree, com.github.javaparser.ast.stmt.DoStmt javaParserNode) Process aDoWhileLoopTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processEmptyStatement
public abstract void processEmptyStatement(com.sun.source.tree.EmptyStatementTree javacTree, com.github.javaparser.ast.stmt.EmptyStmt javaParserNode) Process anEmptyStatementTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processEnhancedForLoop
public abstract void processEnhancedForLoop(com.sun.source.tree.EnhancedForLoopTree javacTree, com.github.javaparser.ast.stmt.ForEachStmt javaParserNode) Process anEnhancedForLoopTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processExports
public abstract void processExports(com.sun.source.tree.ExportsTree javacTree, com.github.javaparser.ast.modules.ModuleExportsDirective javaParserNode) Process anExportsTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processExpressionStatemen
public abstract void processExpressionStatemen(com.sun.source.tree.ExpressionStatementTree javacTree, com.github.javaparser.ast.stmt.ExpressionStmt javaParserNode) Process anExpressionStatementTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processForLoop
public abstract void processForLoop(com.sun.source.tree.ForLoopTree javacTree, com.github.javaparser.ast.stmt.ForStmt javaParserNode) Process aForLoopTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processIdentifier
public abstract void processIdentifier(com.sun.source.tree.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(com.sun.source.tree.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(com.sun.source.tree.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(com.sun.source.tree.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(com.sun.source.tree.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(com.sun.source.tree.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(com.sun.source.tree.IfTree javacTree, com.github.javaparser.ast.stmt.IfStmt javaParserNode) Process anIfTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processImport
public abstract void processImport(com.sun.source.tree.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(com.sun.source.tree.InstanceOfTree javacTree, com.github.javaparser.ast.expr.InstanceOfExpr javaParserNode) Process anInstanceOfTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processIntersectionType
public abstract void processIntersectionType(com.sun.source.tree.IntersectionTypeTree javacTree, com.github.javaparser.ast.type.IntersectionType javaParserNode) Process anIntersectionType
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processLabeledStatement
public abstract void processLabeledStatement(com.sun.source.tree.LabeledStatementTree javacTree, com.github.javaparser.ast.stmt.LabeledStmt javaParserNode) Process aLabeledStatement
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processLambdaExpression
public abstract void processLambdaExpression(com.sun.source.tree.LambdaExpressionTree javacTree, com.github.javaparser.ast.expr.LambdaExpr javaParserNode) Process aLambdaExpressionTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processLiteral
public abstract void processLiteral(com.sun.source.tree.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(com.sun.source.tree.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(com.sun.source.tree.LiteralTree javacTree, com.github.javaparser.ast.expr.LiteralExpr javaParserNode) Process aLiteralTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processMemberReference
public abstract void processMemberReference(com.sun.source.tree.MemberReferenceTree javacTree, com.github.javaparser.ast.expr.MethodReferenceExpr javaParserNode) Process aMemberReferenceTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processMemberSelect
public abstract void processMemberSelect(com.sun.source.tree.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(com.sun.source.tree.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(com.sun.source.tree.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(com.sun.source.tree.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(com.sun.source.tree.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(com.sun.source.tree.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(com.sun.source.tree.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(com.sun.source.tree.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(com.sun.source.tree.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(com.sun.source.tree.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(com.sun.source.tree.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(com.sun.source.tree.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(com.sun.source.tree.ModuleTree javacTree, com.github.javaparser.ast.modules.ModuleDeclaration javaParserNode) Process aModuleTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processNewClass
public abstract void processNewClass(com.sun.source.tree.NewClassTree javacTree, com.github.javaparser.ast.expr.ObjectCreationExpr javaParserNode) Process aNewClassTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processOpens
public abstract void processOpens(com.sun.source.tree.OpensTree javacTree, com.github.javaparser.ast.modules.ModuleOpensDirective javaParserNode) Process anOpensTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processOther
public abstract void processOther(com.sun.source.tree.Tree javacTree, com.github.javaparser.ast.Node javaParserNode) 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(com.sun.source.tree.PackageTree javacTree, com.github.javaparser.ast.PackageDeclaration javaParserNode) Process aPackageTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processParameterizedType
public abstract void processParameterizedType(com.sun.source.tree.ParameterizedTypeTree javacTree, com.github.javaparser.ast.type.ClassOrInterfaceType javaParserNode) Process aParameterizedTypeTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processParenthesized
public abstract void processParenthesized(com.sun.source.tree.ParenthesizedTree javacTree, com.github.javaparser.ast.expr.EnclosedExpr javaParserNode) Process aParenthesizedTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processPrimitiveType
public abstract void processPrimitiveType(com.sun.source.tree.PrimitiveTypeTree javacTree, com.github.javaparser.ast.type.PrimitiveType javaParserNode) Process aPrimitiveTypeTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processPrimitiveType
public abstract void processPrimitiveType(com.sun.source.tree.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(com.sun.source.tree.ProvidesTree javacTree, com.github.javaparser.ast.modules.ModuleProvidesDirective javaParserNode) Process aProvidesTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processRequires
public abstract void processRequires(com.sun.source.tree.RequiresTree javacTree, com.github.javaparser.ast.modules.ModuleRequiresDirective javaParserNode) Process aRequiresTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processReturn
public abstract void processReturn(com.sun.source.tree.ReturnTree javacTree, com.github.javaparser.ast.stmt.ReturnStmt javaParserNode) Process aRetrunTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processSwitch
public abstract void processSwitch(com.sun.source.tree.SwitchTree javacTree, com.github.javaparser.ast.stmt.SwitchStmt javaParserNode) Process aSwitchTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processSwitchExpression
public abstract void processSwitchExpression(com.sun.source.tree.Tree javacTree, com.github.javaparser.ast.expr.SwitchExpr javaParserNode) Process aSwitchExpressionTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processSynchronized
public abstract void processSynchronized(com.sun.source.tree.SynchronizedTree javacTree, com.github.javaparser.ast.stmt.SynchronizedStmt javaParserNode) Process aSynchronizedTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processThrow
public abstract void processThrow(com.sun.source.tree.ThrowTree javacTree, com.github.javaparser.ast.stmt.ThrowStmt javaParserNode) Process aThrowTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processTry
public abstract void processTry(com.sun.source.tree.TryTree javacTree, com.github.javaparser.ast.stmt.TryStmt javaParserNode) Process aTryTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processTypeCast
public abstract void processTypeCast(com.sun.source.tree.TypeCastTree javacTree, com.github.javaparser.ast.expr.CastExpr javaParserNode) Process aTypeCastTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processTypeParameter
public abstract void processTypeParameter(com.sun.source.tree.TypeParameterTree javacTree, com.github.javaparser.ast.type.TypeParameter javaParserNode) Process aTypeParameterTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processUnary
public abstract void processUnary(com.sun.source.tree.UnaryTree javacTree, com.github.javaparser.ast.expr.UnaryExpr javaParserNode) Process aUnaryTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processUnionType
public abstract void processUnionType(com.sun.source.tree.UnionTypeTree javacTree, com.github.javaparser.ast.type.UnionType javaParserNode) Process aUnionTypeTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processUses
public abstract void processUses(com.sun.source.tree.UsesTree javacTree, com.github.javaparser.ast.modules.ModuleUsesDirective javaParserNode) Process aUsesTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processVariable
public abstract void processVariable(com.sun.source.tree.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(com.sun.source.tree.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(com.sun.source.tree.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(com.sun.source.tree.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(com.sun.source.tree.WhileLoopTree javacTree, com.github.javaparser.ast.stmt.WhileStmt javaParserNode) Process aWhileLoopTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processWildcard
public abstract void processWildcard(com.sun.source.tree.WildcardTree javacTree, com.github.javaparser.ast.type.WildcardType javaParserNode) Process aWhileLoopTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
processYield
public abstract void processYield(com.sun.source.tree.Tree javacTree, com.github.javaparser.ast.stmt.YieldStmt javaParserNode) Process aYieldTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding Javaparser node
-
processCompoundAssignment
public abstract void processCompoundAssignment(com.sun.source.tree.CompoundAssignmentTree javacTree, com.github.javaparser.ast.expr.AssignExpr javaParserNode) Process aCompoundAssignmentTree
.- Parameters:
javacTree
- tree to processjavaParserNode
- corresponding JavaParser node
-
castNode
public <T> T castNode(Class<T> type, com.github.javaparser.ast.Node javaParserNode, com.sun.source.tree.Tree javacTree) 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 classcom.sun.source.util.SimpleTreeVisitor<Void,
com.github.javaparser.ast.Node> - Parameters:
tree
- the Javac treenode
- the Javaparser node- Returns:
- nothing
-