org.eclipse.jdt.core.dom.ASTVisitor Maven / Gradle / Ivy
/*******************************************************************************
* Copyright (c) 2000, 2023 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.jdt.core.dom;
/**
* A visitor for abstract syntax trees.
*
* For each different concrete AST node type T there are
* a pair of methods:
*
* public boolean visit(T node)
- Visits
* the given node to perform some arbitrary operation. If true
* is returned, the given node's child nodes will be visited next; however,
* if false
is returned, the given node's child nodes will
* not be visited. The default implementation provided by this class does
* nothing and returns true
(with the exception of
* {@link #visit(Javadoc) ASTVisitor.visit(Javadoc)}).
* Subclasses may reimplement this method as needed.
* public void endVisit(T node)
- Visits
* the given node to perform some arbitrary operation. When used in the
* conventional way, this method is called after all of the given node's
* children have been visited (or immediately, if visit
returned
* false
). The default implementation provided by this class does
* nothing. Subclasses may reimplement this method as needed.
*
*
* In addition, there are a pair of methods for visiting AST nodes in the
* abstract, regardless of node type:
*
* public void preVisit(ASTNode node)
- Visits
* the given node to perform some arbitrary operation.
* This method is invoked prior to the appropriate type-specific
* visit
method.
* The default implementation of this method does nothing.
* Subclasses may reimplement this method as needed.
* public void postVisit(ASTNode node)
- Visits
* the given node to perform some arbitrary operation.
* This method is invoked after the appropriate type-specific
* endVisit
method.
* The default implementation of this method does nothing.
* Subclasses may reimplement this method as needed.
*
*
* For nodes with list-valued properties, the child nodes within the list
* are visited in order. For nodes with multiple properties, the child nodes
* are visited in the order that most closely corresponds to the lexical
* reading order of the source program. For instance, for a type declaration
* node, the child ordering is: name, superclass, superinterfaces, and
* body declarations.
*
*
* While it is possible to modify the tree in the visitor, care is required to
* ensure that the consequences are as expected and desirable.
* During the course of an ordinary visit starting at a given node, every node
* in the subtree is visited exactly twice, first with visit
and
* then with endVisit
. During a traversal of a stationary tree,
* each node is either behind (after endVisit
), ahead (before
* visit
), or in progress (between visit
and
* the matching endVisit
). Changes to the "behind" region of the
* tree are of no consequence to the visit in progress. Changes to the "ahead"
* region will be taken in stride. Changes to the "in progress" portion are
* the more interesting cases. With a node, the various properties are arranged
* in a linear list, with a cursor that separates the properties that have
* been visited from the ones that are still to be visited (the cursor
* is between the elements, rather than on an element). The cursor moves from
* the head to the tail of this list, advancing to the next position just
* before visit
if called for that child. After the child
* subtree has been completely visited, the visit moves on the child
* immediately after the cursor. Removing a child while it is being visited
* does not alter the course of the visit. But any children added at positions
* after the cursor are considered in the "ahead" portion and will be visited.
*
*
* Cases to watch out for:
*
* - Moving a child node further down the list. This could result in the
* child subtree being visited multiple times; these visits are sequential.
* - Moving a child node up into an ancestor. If the new home for
* the node is in the "ahead" portion, the subtree will be visited
* a second time; again, these visits are sequential.
* - Moving a node down into a child. If the new home for
* the node is in the "ahead" portion, the subtree will be visited
* a second time; in this case, the visits will be nested. In some cases,
* this can lead to a stack overflow or out of memory condition.
*
* Note that {@link LineComment} and {@link BlockComment} nodes are
* not normally visited in an AST because they are not considered
* part of main structure of the AST. Use
* {@link CompilationUnit#getCommentList()} to find these additional
* comments nodes.
*
*
* @see org.eclipse.jdt.core.dom.ASTNode#accept(ASTVisitor)
*/
public abstract class ASTVisitor {
/**
* Indicates whether doc tags should be visited by default.
* @since 3.0
*/
private final boolean visitDocTags;
/**
* Creates a new AST visitor instance.
*
* For backwards compatibility, the visitor does not visit tag
* elements below doc comments by default. Use
* {@link #ASTVisitor(boolean) ASTVisitor(true)}
* for an visitor that includes doc comments by default.
*
*/
public ASTVisitor() {
this(false);
}
/**
* Creates a new AST visitor instance.
*
* @param visitDocTags true
if doc comment tags are
* to be visited by default, and false
otherwise
* @see Javadoc#tags()
* @see #visit(Javadoc)
* @since 3.0
*/
public ASTVisitor(boolean visitDocTags) {
this.visitDocTags = visitDocTags;
}
/**
* Visits the given AST node prior to the type-specific visit
* (before visit
).
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*
* @see #preVisit2(ASTNode)
*/
public void preVisit(ASTNode node) {
// default implementation: do nothing
}
/**
* Visits the given AST node prior to the type-specific visit (before visit
).
*
* The default implementation calls {@link #preVisit(ASTNode)} and then
* returns true. Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if visit(node)
should be called,
* and false
otherwise.
* @see #preVisit(ASTNode)
* @since 3.5
*/
public boolean preVisit2(ASTNode node) {
preVisit(node);
return true;
}
/**
* Visits the given AST node following the type-specific visit
* (after endVisit
).
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void postVisit(ASTNode node) {
// default implementation: do nothing
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.1
*/
public boolean visit(AnnotationTypeDeclaration node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.1
*/
public boolean visit(AnnotationTypeMemberDeclaration node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(AnonymousClassDeclaration node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(ArrayAccess node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(ArrayCreation node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(ArrayInitializer node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(ArrayType node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(AssertStatement node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(Assignment node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(Block node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
* Note: {@link LineComment} and {@link BlockComment} nodes are
* not considered part of main structure of the AST. This method will
* only be called if a client goes out of their way to visit this
* kind of node explicitly.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.0
*/
public boolean visit(BlockComment node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(BooleanLiteral node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(BreakStatement node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.28
*/
public boolean visit(CaseDefaultExpression node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(CastExpression node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(CatchClause node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(CharacterLiteral node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(ClassInstanceCreation node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(CompilationUnit node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(ConditionalExpression node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(ConstructorInvocation node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(ContinueStatement node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may re-implement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.10
*/
public boolean visit(CreationReference node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.10
*/
public boolean visit(Dimension node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(DoStatement node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(EmptyStatement node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.1
*/
public boolean visit(EnhancedForStatement node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*
* @since 3.33
* @noreference This method is not intended to be referenced by clients.
*/
public boolean visit(EnhancedForWithRecordPattern node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.1
*/
public boolean visit(EnumConstantDeclaration node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.1
*/
public boolean visit(EnumDeclaration node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may re-implement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.14
*/
public boolean visit(ExportsDirective node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may re-implement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.10
*/
public boolean visit(ExpressionMethodReference node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(ExpressionStatement node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(FieldAccess node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(FieldDeclaration node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(ForStatement node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.28
*/
public boolean visit(GuardedPattern node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(IfStatement node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(ImportDeclaration node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(InfixExpression node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(Initializer node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(InstanceofExpression node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.10
*/
public boolean visit(IntersectionType node) {
return true;
}
/**
* Visits the given AST node.
*
* Unlike other node types, the boolean returned by the default
* implementation is controlled by a constructor-supplied
* parameter {@link #ASTVisitor(boolean) ASTVisitor(boolean)}
* which is false
by default.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @see #ASTVisitor()
* @see #ASTVisitor(boolean)
*/
public boolean visit(Javadoc node) {
// visit tag elements inside doc comments only if requested
return this.visitDocTags;
}
/**
* Visits the given AST node.
*
* Unlike other node types, the boolean returned by the default
* implementation is controlled by a constructor-supplied
* parameter {@link #ASTVisitor(boolean) ASTVisitor(boolean)}
* which is false
by default.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @see #ASTVisitor()
* @see #ASTVisitor(boolean)
* @since 3.30
*/
public boolean visit(JavaDocRegion node) {
return this.visitDocTags;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.31
*/
public boolean visit(JavaDocTextElement node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(LabeledStatement node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.10
*/
public boolean visit(LambdaExpression node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
* Note: {@link LineComment} and {@link BlockComment} nodes are
* not considered part of main structure of the AST. This method will
* only be called if a client goes out of their way to visit this
* kind of node explicitly.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.0
*/
public boolean visit(LineComment node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.1
*/
public boolean visit(MarkerAnnotation node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.0
*/
public boolean visit(MemberRef node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.1
*/
public boolean visit(MemberValuePair node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.0
*/
public boolean visit(MethodRef node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.0
*/
public boolean visit(MethodRefParameter node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(MethodDeclaration node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(MethodInvocation node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.1
*/
public boolean visit(Modifier node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.14
*/
public boolean visit(ModuleDeclaration node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.14
*/
public boolean visit(ModuleModifier node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.10
*/
public boolean visit(NameQualifiedType node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.1
*/
public boolean visit(NormalAnnotation node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(NullLiteral node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.28
*/
public boolean visit(NullPattern node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(NumberLiteral node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may re-implement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.14
*/
public boolean visit(OpensDirective node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(PackageDeclaration node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.1
*/
public boolean visit(ParameterizedType node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(ParenthesizedExpression node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.26
*/
public boolean visit(PatternInstanceofExpression node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(PostfixExpression node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(PrefixExpression node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may re-implement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.14
*/
public boolean visit(ProvidesDirective node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(PrimitiveType node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(QualifiedName node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.1
*/
public boolean visit(QualifiedType node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @noreference
*/
public boolean visit(ModuleQualifiedName node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may re-implement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.14
*/
public boolean visit(RequiresDirective node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may re-implement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.22
* @noreference This method is not intended to be referenced by clients.
*/
public boolean visit(RecordDeclaration node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.32
*/
public boolean visit(RecordPattern node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(ReturnStatement node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(SimpleName node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(SimpleType node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.1
*/
public boolean visit(SingleMemberAnnotation node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(SingleVariableDeclaration node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(StringLiteral node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(SuperConstructorInvocation node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(SuperFieldAccess node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(SuperMethodInvocation node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.10
*/
public boolean visit(SuperMethodReference node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(SwitchCase node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.24
*/
public boolean visit(SwitchExpression node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(SwitchStatement node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(SynchronizedStatement node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.0
*/
public boolean visit(TagElement node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.30
*/
public boolean visit(TagProperty node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and returns true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.24
*/
public boolean visit(TextBlock node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.0
*/
public boolean visit(TextElement node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(ThisExpression node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(ThrowStatement node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(TryStatement node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(TypeDeclaration node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(TypeDeclarationStatement node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(TypeLiteral node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*
* @since 3.10
*/
public boolean visit(TypeMethodReference node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.1
*/
public boolean visit(TypeParameter node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.28
*/
public boolean visit(TypePattern node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.7.1
*/
public boolean visit(UnionType node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may re-implement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.14
*/
public boolean visit(UsesDirective node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(VariableDeclarationExpression node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(VariableDeclarationStatement node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(VariableDeclarationFragment node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
*/
public boolean visit(WhileStatement node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and return true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.1
*/
public boolean visit(WildcardType node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and returns true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.24
*/
public boolean visit(YieldStatement node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and returns true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.37
* @noreference This method is not intended to be referenced by clients.
*/
public boolean visit(StringTemplateExpression node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and returns true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.37
* @noreference This method is not intended to be referenced by clients.
*/
public boolean visit(StringFragment node) {
return true;
}
/**
* Visits the given type-specific AST node.
*
* The default implementation does nothing and returns true.
* Subclasses may reimplement.
*
*
* @param node the node to visit
* @return true
if the children of this node should be
* visited, and false
if the children of this node should
* be skipped
* @since 3.37
* @noreference This method is not intended to be referenced by clients.
*/
public boolean visit(StringTemplateComponent node) {
return true;
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.1
*/
public void endVisit(AnnotationTypeDeclaration node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.1
*/
public void endVisit(AnnotationTypeMemberDeclaration node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(AnonymousClassDeclaration node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(ArrayAccess node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(ArrayCreation node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(ArrayInitializer node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(ArrayType node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(AssertStatement node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(Assignment node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(Block node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
* Note: {@link LineComment} and {@link BlockComment} nodes are
* not considered part of main structure of the AST. This method will
* only be called if a client goes out of their way to visit this
* kind of node explicitly.
*
*
* @param node the node to visit
* @since 3.0
*/
public void endVisit(BlockComment node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(BooleanLiteral node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(BreakStatement node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.28
*/
public void endVisit(CaseDefaultExpression node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(CastExpression node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(CatchClause node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(CharacterLiteral node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(ClassInstanceCreation node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(CompilationUnit node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(ConditionalExpression node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(ConstructorInvocation node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(ContinueStatement node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.10
*/
public void endVisit(CreationReference node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(DoStatement node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(EmptyStatement node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.1
*/
public void endVisit(EnhancedForStatement node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.33
* @noreference This method is not intended to be referenced by clients.
*/
public void endVisit(EnhancedForWithRecordPattern node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.1
*/
public void endVisit(EnumConstantDeclaration node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.1
*/
public void endVisit(EnumDeclaration node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.14
*/
public void endVisit(ExportsDirective node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.10
*/
public void endVisit(ExpressionMethodReference node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(ExpressionStatement node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.10
*/
public void endVisit(Dimension node) {
// do nothing by default
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(FieldAccess node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(FieldDeclaration node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(ForStatement node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.28
*/
public void endVisit(GuardedPattern node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(IfStatement node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(ImportDeclaration node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(InfixExpression node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(InstanceofExpression node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(Initializer node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(Javadoc node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.30
*/
public void endVisit(JavaDocRegion node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.32
*/
public void endVisit(JavaDocTextElement node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(LabeledStatement node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.10
*/
public void endVisit(LambdaExpression node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
* Note: {@link LineComment} and {@link BlockComment} nodes are
* not considered part of main structure of the AST. This method will
* only be called if a client goes out of their way to visit this
* kind of node explicitly.
*
*
* @param node the node to visit
* @since 3.0
*/
public void endVisit(LineComment node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.1
*/
public void endVisit(MarkerAnnotation node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.0
*/
public void endVisit(MemberRef node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.1
*/
public void endVisit(MemberValuePair node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.0
*/
public void endVisit(MethodRef node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.0
*/
public void endVisit(MethodRefParameter node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(MethodDeclaration node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(MethodInvocation node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.1
*/
public void endVisit(Modifier node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.14
*/
public void endVisit(ModuleDeclaration node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.14
*/
public void endVisit(ModuleModifier node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.10
*/
public void endVisit(NameQualifiedType node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.1
*/
public void endVisit(NormalAnnotation node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(NullLiteral node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.28
*/
public void endVisit(NullPattern node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(NumberLiteral node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.14
*/
public void endVisit(OpensDirective node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(PackageDeclaration node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.1
*/
public void endVisit(ParameterizedType node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(ParenthesizedExpression node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.26
*/
public void endVisit(PatternInstanceofExpression node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(PostfixExpression node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(PrefixExpression node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(PrimitiveType node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.14
*/
public void endVisit(ProvidesDirective node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(QualifiedName node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.1
*/
public void endVisit(QualifiedType node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @noreference
*/
public void endVisit(ModuleQualifiedName node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.14
*/
public void endVisit(RequiresDirective node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may re implement.
*
*
* @param node the node to visit
* @since 3.22
* @noreference This method is not intended to be referenced by clients.
*/
public void endVisit(RecordDeclaration node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may re implement.
*
*
* @param node the node to visit
* @since 3.31
* @noreference This method is not intended to be referenced by clients.
*/
public void endVisit(RecordPattern node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(ReturnStatement node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(SimpleName node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(SimpleType node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.1
*/
public void endVisit(SingleMemberAnnotation node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(SingleVariableDeclaration node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(StringLiteral node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(SuperConstructorInvocation node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(SuperFieldAccess node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(SuperMethodInvocation node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.10
*/
public void endVisit(SuperMethodReference node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(SwitchCase node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.18
*/
public void endVisit(SwitchExpression node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(SwitchStatement node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(SynchronizedStatement node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.0
*/
public void endVisit(TagElement node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.30
*/
public void endVisit(TagProperty node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.24
*/
public void endVisit(TextBlock node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.0
*/
public void endVisit(TextElement node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(ThisExpression node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(ThrowStatement node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(TryStatement node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(TypeDeclaration node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(TypeDeclarationStatement node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(TypeLiteral node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*
* @since 3.10
*/
public void endVisit(TypeMethodReference node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.1
*/
public void endVisit(TypeParameter node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.28
*/
public void endVisit(TypePattern node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.7.1
*/
public void endVisit(UnionType node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.14
*/
public void endVisit(UsesDirective node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.10
*/
public void endVisit(IntersectionType node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(VariableDeclarationExpression node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(VariableDeclarationStatement node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(VariableDeclarationFragment node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
*/
public void endVisit(WhileStatement node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.1
*/
public void endVisit(WildcardType node) {
// default implementation: do nothing
}
/**
* End of visit the given type-specific AST node.
*
* The default implementation does nothing. Subclasses may reimplement.
*
*
* @param node the node to visit
* @since 3.24
*/
public void endVisit(YieldStatement node) {
// default implementation: do nothing
}
/**
* @since 3.37
* @noreference This method is not intended to be referenced by clients.
*/
public void endVisit(StringTemplateExpression node) {
// default implementation: do nothing
}
/**
* @since 3.37
* @noreference This method is not intended to be referenced by clients.
*/
public void endVisit(StringFragment node) {
// default implementation: do nothing
}
/**
* @since 3.37
* @noreference This method is not intended to be referenced by clients.
*/
public void endVisit(StringTemplateComponent node) {
// default implementation: do nothing
}
}