0001: /*******************************************************************************
0002: * Copyright (c) 2000, 2007 IBM Corporation and others.
0003: * All rights reserved. This program and the accompanying materials
0004: * are made available under the terms of the Eclipse Public License v1.0
0005: * which accompanies this distribution, and is available at
0006: * http://www.eclipse.org/legal/epl-v10.html
0007: *
0008: * Contributors:
0009: * IBM Corporation - initial API and implementation
0010: *******************************************************************************/package org.eclipse.jdt.core.dom;
0011:
0012: /**
0013: * A visitor for abstract syntax trees.
0014: * <p>
0015: * For each different concrete AST node type <i>T</i> there are
0016: * a pair of methods:
0017: * <ul>
0018: * <li><code>public boolean visit(<i>T</i> node)</code> - Visits
0019: * the given node to perform some arbitrary operation. If <code>true</code>
0020: * is returned, the given node's child nodes will be visited next; however,
0021: * if <code>false</code> is returned, the given node's child nodes will
0022: * not be visited. The default implementation provided by this class does
0023: * nothing and returns <code>true</code> (with the exception of
0024: * {@link #visit(Javadoc) ASTVisitor.visit(Javadoc)}).
0025: * Subclasses may reimplement this method as needed.</li>
0026: * <li><code>public void endVisit(<i>T</i> node)</code> - Visits
0027: * the given node to perform some arbitrary operation. When used in the
0028: * conventional way, this method is called after all of the given node's
0029: * children have been visited (or immediately, if <code>visit</code> returned
0030: * <code>false</code>). The default implementation provided by this class does
0031: * nothing. Subclasses may reimplement this method as needed.</li>
0032: * </ul>
0033: * </p>
0034: * In addition, there are a pair of methods for visiting AST nodes in the
0035: * abstract, regardless of node type:
0036: * <ul>
0037: * <li><code>public void preVisit(ASTNode node)</code> - Visits
0038: * the given node to perform some arbitrary operation.
0039: * This method is invoked prior to the appropriate type-specific
0040: * <code>visit</code> method.
0041: * The default implementation of this method does nothing.
0042: * Subclasses may reimplement this method as needed.</li>
0043: * <li><code>public void postVisit(ASTNode node)</code> - Visits
0044: * the given node to perform some arbitrary operation.
0045: * This method is invoked after the appropriate type-specific
0046: * <code>endVisit</code> method.
0047: * The default implementation of this method does nothing.
0048: * Subclasses may reimplement this method as needed.</li>
0049: * </ul>
0050: * <p>
0051: * For nodes with list-valued properties, the child nodes within the list
0052: * are visited in order. For nodes with multiple properties, the child nodes
0053: * are visited in the order that most closely corresponds to the lexical
0054: * reading order of the source program. For instance, for a type declaration
0055: * node, the child ordering is: name, superclass, superinterfaces, and
0056: * body declarations.
0057: * </p>
0058: * <p>
0059: * While it is possible to modify the tree in the visitor, care is required to
0060: * ensure that the consequences are as expected and desirable.
0061: * During the course of an ordinary visit starting at a given node, every node
0062: * in the subtree is visited exactly twice, first with <code>visit</code> and
0063: * then with <code>endVisit</code>. During a traversal of a stationary tree,
0064: * each node is either behind (after <code>endVisit</code>), ahead (before
0065: * <code>visit</code>), or in progress (between <code>visit</code> and
0066: * the matching <code>endVisit</code>). Changes to the "behind" region of the
0067: * tree are of no consequence to the visit in progress. Changes to the "ahead"
0068: * region will be taken in stride. Changes to the "in progress" portion are
0069: * the more interesting cases. With a node, the various properties are arranged
0070: * in a linear list, with a cursor that separates the properties that have
0071: * been visited from the ones that are still to be visited (the cursor
0072: * is between the elements, rather than on an element). The cursor moves from
0073: * the head to the tail of this list, advancing to the next position just
0074: * <i>before</i> <code>visit</code> if called for that child. After the child
0075: * subtree has been completely visited, the visit moves on the child
0076: * immediately after the cursor. Removing a child while it is being visited
0077: * does not alter the course of the visit. But any children added at positions
0078: * after the cursor are considered in the "ahead" portion and will be visited.
0079: * </p>
0080: * <p>
0081: * Cases to watch out for:
0082: * <ul>
0083: * <li>Moving a child node further down the list. This could result in the
0084: * child subtree being visited multiple times; these visits are sequential.</li>
0085: * <li>Moving a child node up into an ancestor. If the new home for
0086: * the node is in the "ahead" portion, the subtree will be visited
0087: * a second time; again, these visits are sequential.</li>
0088: * <li>Moving a node down into a child. If the new home for
0089: * the node is in the "ahead" portion, the subtree will be visited
0090: * a second time; in this case, the visits will be nested. In some cases,
0091: * this can lead to a stack overflow or out of memory condition.</li>
0092: * </ul>
0093: * <p>Note that {@link LineComment} and {@link BlockComment} nodes are
0094: * not normally visited in an AST because they are not considered
0095: * part of main structure of the AST. Use
0096: * {@link CompilationUnit#getCommentList()} to find these additional
0097: * comments nodes.
0098: * </p>
0099: *
0100: * @see org.eclipse.jdt.core.dom.ASTNode#accept(ASTVisitor)
0101: */
0102: public abstract class ASTVisitor {
0103:
0104: /**
0105: * Indicates whether doc tags should be visited by default.
0106: * @since 3.0
0107: */
0108: private boolean visitDocTags;
0109:
0110: /**
0111: * Creates a new AST visitor instance.
0112: * <p>
0113: * For backwards compatibility, the visitor does not visit tag
0114: * elements below doc comments by default. Use
0115: * {@link #ASTVisitor(boolean) ASTVisitor(true)}
0116: * for an visitor that includes doc comments by default.
0117: * </p>
0118: */
0119: public ASTVisitor() {
0120: this (false);
0121: }
0122:
0123: /**
0124: * Creates a new AST visitor instance.
0125: *
0126: * @param visitDocTags <code>true</code> if doc comment tags are
0127: * to be visited by default, and <code>false</code> otherwise
0128: * @see Javadoc#tags()
0129: * @see #visit(Javadoc)
0130: * @since 3.0
0131: */
0132: public ASTVisitor(boolean visitDocTags) {
0133: this .visitDocTags = visitDocTags;
0134: }
0135:
0136: /**
0137: * Visits the given AST node prior to the type-specific visit.
0138: * (before <code>visit</code>).
0139: * <p>
0140: * The default implementation does nothing. Subclasses may reimplement.
0141: * </p>
0142: *
0143: * @param node the node to visit
0144: */
0145: public void preVisit(ASTNode node) {
0146: // default implementation: do nothing
0147: }
0148:
0149: /**
0150: * Visits the given AST node following the type-specific visit
0151: * (after <code>endVisit</code>).
0152: * <p>
0153: * The default implementation does nothing. Subclasses may reimplement.
0154: * </p>
0155: *
0156: * @param node the node to visit
0157: */
0158: public void postVisit(ASTNode node) {
0159: // default implementation: do nothing
0160: }
0161:
0162: /**
0163: * Visits the given type-specific AST node.
0164: * <p>
0165: * The default implementation does nothing and return true.
0166: * Subclasses may reimplement.
0167: * </p>
0168: *
0169: * @param node the node to visit
0170: * @return <code>true</code> if the children of this node should be
0171: * visited, and <code>false</code> if the children of this node should
0172: * be skipped
0173: * @since 3.1
0174: */
0175: public boolean visit(AnnotationTypeDeclaration node) {
0176: return true;
0177: }
0178:
0179: /**
0180: * Visits the given type-specific AST node.
0181: * <p>
0182: * The default implementation does nothing and return true.
0183: * Subclasses may reimplement.
0184: * </p>
0185: *
0186: * @param node the node to visit
0187: * @return <code>true</code> if the children of this node should be
0188: * visited, and <code>false</code> if the children of this node should
0189: * be skipped
0190: * @since 3.1
0191: */
0192: public boolean visit(AnnotationTypeMemberDeclaration node) {
0193: return true;
0194: }
0195:
0196: /**
0197: * Visits the given type-specific AST node.
0198: * <p>
0199: * The default implementation does nothing and return true.
0200: * Subclasses may reimplement.
0201: * </p>
0202: *
0203: * @param node the node to visit
0204: * @return <code>true</code> if the children of this node should be
0205: * visited, and <code>false</code> if the children of this node should
0206: * be skipped
0207: */
0208: public boolean visit(AnonymousClassDeclaration node) {
0209: return true;
0210: }
0211:
0212: /**
0213: * Visits the given type-specific AST node.
0214: * <p>
0215: * The default implementation does nothing and return true.
0216: * Subclasses may reimplement.
0217: * </p>
0218: *
0219: * @param node the node to visit
0220: * @return <code>true</code> if the children of this node should be
0221: * visited, and <code>false</code> if the children of this node should
0222: * be skipped
0223: */
0224: public boolean visit(ArrayAccess node) {
0225: return true;
0226: }
0227:
0228: /**
0229: * Visits the given type-specific AST node.
0230: * <p>
0231: * The default implementation does nothing and return true.
0232: * Subclasses may reimplement.
0233: * </p>
0234: *
0235: * @param node the node to visit
0236: * @return <code>true</code> if the children of this node should be
0237: * visited, and <code>false</code> if the children of this node should
0238: * be skipped
0239: */
0240: public boolean visit(ArrayCreation node) {
0241: return true;
0242: }
0243:
0244: /**
0245: * Visits the given type-specific AST node.
0246: * <p>
0247: * The default implementation does nothing and return true.
0248: * Subclasses may reimplement.
0249: * </p>
0250: *
0251: * @param node the node to visit
0252: * @return <code>true</code> if the children of this node should be
0253: * visited, and <code>false</code> if the children of this node should
0254: * be skipped
0255: */
0256: public boolean visit(ArrayInitializer node) {
0257: return true;
0258: }
0259:
0260: /**
0261: * Visits the given type-specific AST node.
0262: * <p>
0263: * The default implementation does nothing and return true.
0264: * Subclasses may reimplement.
0265: * </p>
0266: *
0267: * @param node the node to visit
0268: * @return <code>true</code> if the children of this node should be
0269: * visited, and <code>false</code> if the children of this node should
0270: * be skipped
0271: */
0272: public boolean visit(ArrayType node) {
0273: return true;
0274: }
0275:
0276: /**
0277: * Visits the given type-specific AST node.
0278: * <p>
0279: * The default implementation does nothing and return true.
0280: * Subclasses may reimplement.
0281: * </p>
0282: *
0283: * @param node the node to visit
0284: * @return <code>true</code> if the children of this node should be
0285: * visited, and <code>false</code> if the children of this node should
0286: * be skipped
0287: */
0288: public boolean visit(AssertStatement node) {
0289: return true;
0290: }
0291:
0292: /**
0293: * Visits the given type-specific AST node.
0294: * <p>
0295: * The default implementation does nothing and return true.
0296: * Subclasses may reimplement.
0297: * </p>
0298: *
0299: * @param node the node to visit
0300: * @return <code>true</code> if the children of this node should be
0301: * visited, and <code>false</code> if the children of this node should
0302: * be skipped
0303: */
0304: public boolean visit(Assignment node) {
0305: return true;
0306: }
0307:
0308: /**
0309: * Visits the given type-specific AST node.
0310: * <p>
0311: * The default implementation does nothing and return true.
0312: * Subclasses may reimplement.
0313: * </p>
0314: *
0315: * @param node the node to visit
0316: * @return <code>true</code> if the children of this node should be
0317: * visited, and <code>false</code> if the children of this node should
0318: * be skipped
0319: */
0320: public boolean visit(Block node) {
0321: return true;
0322: }
0323:
0324: /**
0325: * Visits the given type-specific AST node.
0326: * <p>
0327: * The default implementation does nothing and return true.
0328: * Subclasses may reimplement.
0329: * </p>
0330: * <p>Note: {@link LineComment} and {@link BlockComment} nodes are
0331: * not considered part of main structure of the AST. This method will
0332: * only be called if a client goes out of their way to visit this
0333: * kind of node explicitly.
0334: * </p>
0335: *
0336: * @param node the node to visit
0337: * @return <code>true</code> if the children of this node should be
0338: * visited, and <code>false</code> if the children of this node should
0339: * be skipped
0340: * @since 3.0
0341: */
0342: public boolean visit(BlockComment node) {
0343: return true;
0344: }
0345:
0346: /**
0347: * Visits the given type-specific AST node.
0348: * <p>
0349: * The default implementation does nothing and return true.
0350: * Subclasses may reimplement.
0351: * </p>
0352: *
0353: * @param node the node to visit
0354: * @return <code>true</code> if the children of this node should be
0355: * visited, and <code>false</code> if the children of this node should
0356: * be skipped
0357: */
0358: public boolean visit(BooleanLiteral node) {
0359: return true;
0360: }
0361:
0362: /**
0363: * Visits the given type-specific AST node.
0364: * <p>
0365: * The default implementation does nothing and return true.
0366: * Subclasses may reimplement.
0367: * </p>
0368: *
0369: * @param node the node to visit
0370: * @return <code>true</code> if the children of this node should be
0371: * visited, and <code>false</code> if the children of this node should
0372: * be skipped
0373: */
0374: public boolean visit(BreakStatement node) {
0375: return true;
0376: }
0377:
0378: /**
0379: * Visits the given type-specific AST node.
0380: * <p>
0381: * The default implementation does nothing and return true.
0382: * Subclasses may reimplement.
0383: * </p>
0384: *
0385: * @param node the node to visit
0386: * @return <code>true</code> if the children of this node should be
0387: * visited, and <code>false</code> if the children of this node should
0388: * be skipped
0389: */
0390: public boolean visit(CastExpression node) {
0391: return true;
0392: }
0393:
0394: /**
0395: * Visits the given type-specific AST node.
0396: * <p>
0397: * The default implementation does nothing and return true.
0398: * Subclasses may reimplement.
0399: * </p>
0400: *
0401: * @param node the node to visit
0402: * @return <code>true</code> if the children of this node should be
0403: * visited, and <code>false</code> if the children of this node should
0404: * be skipped
0405: */
0406: public boolean visit(CatchClause node) {
0407: return true;
0408: }
0409:
0410: /**
0411: * Visits the given type-specific AST node.
0412: * <p>
0413: * The default implementation does nothing and return true.
0414: * Subclasses may reimplement.
0415: * </p>
0416: *
0417: * @param node the node to visit
0418: * @return <code>true</code> if the children of this node should be
0419: * visited, and <code>false</code> if the children of this node should
0420: * be skipped
0421: */
0422: public boolean visit(CharacterLiteral node) {
0423: return true;
0424: }
0425:
0426: /**
0427: * Visits the given type-specific AST node.
0428: * <p>
0429: * The default implementation does nothing and return true.
0430: * Subclasses may reimplement.
0431: * </p>
0432: *
0433: * @param node the node to visit
0434: * @return <code>true</code> if the children of this node should be
0435: * visited, and <code>false</code> if the children of this node should
0436: * be skipped
0437: */
0438: public boolean visit(ClassInstanceCreation node) {
0439: return true;
0440: }
0441:
0442: /**
0443: * Visits the given type-specific AST node.
0444: * <p>
0445: * The default implementation does nothing and return true.
0446: * Subclasses may reimplement.
0447: * </p>
0448: *
0449: * @param node the node to visit
0450: * @return <code>true</code> if the children of this node should be
0451: * visited, and <code>false</code> if the children of this node should
0452: * be skipped
0453: */
0454: public boolean visit(CompilationUnit node) {
0455: return true;
0456: }
0457:
0458: /**
0459: * Visits the given type-specific AST node.
0460: * <p>
0461: * The default implementation does nothing and return true.
0462: * Subclasses may reimplement.
0463: * </p>
0464: *
0465: * @param node the node to visit
0466: * @return <code>true</code> if the children of this node should be
0467: * visited, and <code>false</code> if the children of this node should
0468: * be skipped
0469: */
0470: public boolean visit(ConditionalExpression node) {
0471: return true;
0472: }
0473:
0474: /**
0475: * Visits the given type-specific AST node.
0476: * <p>
0477: * The default implementation does nothing and return true.
0478: * Subclasses may reimplement.
0479: * </p>
0480: *
0481: * @param node the node to visit
0482: * @return <code>true</code> if the children of this node should be
0483: * visited, and <code>false</code> if the children of this node should
0484: * be skipped
0485: */
0486: public boolean visit(ConstructorInvocation node) {
0487: return true;
0488: }
0489:
0490: /**
0491: * Visits the given type-specific AST node.
0492: * <p>
0493: * The default implementation does nothing and return true.
0494: * Subclasses may reimplement.
0495: * </p>
0496: *
0497: * @param node the node to visit
0498: * @return <code>true</code> if the children of this node should be
0499: * visited, and <code>false</code> if the children of this node should
0500: * be skipped
0501: */
0502: public boolean visit(ContinueStatement node) {
0503: return true;
0504: }
0505:
0506: /**
0507: * Visits the given type-specific AST node.
0508: * <p>
0509: * The default implementation does nothing and return true.
0510: * Subclasses may reimplement.
0511: * </p>
0512: *
0513: * @param node the node to visit
0514: * @return <code>true</code> if the children of this node should be
0515: * visited, and <code>false</code> if the children of this node should
0516: * be skipped
0517: */
0518: public boolean visit(DoStatement node) {
0519: return true;
0520: }
0521:
0522: /**
0523: * Visits the given type-specific AST node.
0524: * <p>
0525: * The default implementation does nothing and return true.
0526: * Subclasses may reimplement.
0527: * </p>
0528: *
0529: * @param node the node to visit
0530: * @return <code>true</code> if the children of this node should be
0531: * visited, and <code>false</code> if the children of this node should
0532: * be skipped
0533: */
0534: public boolean visit(EmptyStatement node) {
0535: return true;
0536: }
0537:
0538: /**
0539: * Visits the given type-specific AST node.
0540: * <p>
0541: * The default implementation does nothing and return true.
0542: * Subclasses may reimplement.
0543: * </p>
0544: *
0545: * @param node the node to visit
0546: * @return <code>true</code> if the children of this node should be
0547: * visited, and <code>false</code> if the children of this node should
0548: * be skipped
0549: * @since 3.1
0550: */
0551: public boolean visit(EnhancedForStatement node) {
0552: return true;
0553: }
0554:
0555: /**
0556: * Visits the given type-specific AST node.
0557: * <p>
0558: * The default implementation does nothing and return true.
0559: * Subclasses may reimplement.
0560: * </p>
0561: *
0562: * @param node the node to visit
0563: * @return <code>true</code> if the children of this node should be
0564: * visited, and <code>false</code> if the children of this node should
0565: * be skipped
0566: * @since 3.1
0567: */
0568: public boolean visit(EnumConstantDeclaration node) {
0569: return true;
0570: }
0571:
0572: /**
0573: * Visits the given type-specific AST node.
0574: * <p>
0575: * The default implementation does nothing and return true.
0576: * Subclasses may reimplement.
0577: * </p>
0578: *
0579: * @param node the node to visit
0580: * @return <code>true</code> if the children of this node should be
0581: * visited, and <code>false</code> if the children of this node should
0582: * be skipped
0583: * @since 3.1
0584: */
0585: public boolean visit(EnumDeclaration node) {
0586: return true;
0587: }
0588:
0589: /**
0590: * Visits the given type-specific AST node.
0591: * <p>
0592: * The default implementation does nothing and return true.
0593: * Subclasses may reimplement.
0594: * </p>
0595: *
0596: * @param node the node to visit
0597: * @return <code>true</code> if the children of this node should be
0598: * visited, and <code>false</code> if the children of this node should
0599: * be skipped
0600: */
0601: public boolean visit(ExpressionStatement node) {
0602: return true;
0603: }
0604:
0605: /**
0606: * Visits the given type-specific AST node.
0607: * <p>
0608: * The default implementation does nothing and return true.
0609: * Subclasses may reimplement.
0610: * </p>
0611: *
0612: * @param node the node to visit
0613: * @return <code>true</code> if the children of this node should be
0614: * visited, and <code>false</code> if the children of this node should
0615: * be skipped
0616: */
0617: public boolean visit(FieldAccess node) {
0618: return true;
0619: }
0620:
0621: /**
0622: * Visits the given type-specific AST node.
0623: * <p>
0624: * The default implementation does nothing and return true.
0625: * Subclasses may reimplement.
0626: * </p>
0627: *
0628: * @param node the node to visit
0629: * @return <code>true</code> if the children of this node should be
0630: * visited, and <code>false</code> if the children of this node should
0631: * be skipped
0632: */
0633: public boolean visit(FieldDeclaration node) {
0634: return true;
0635: }
0636:
0637: /**
0638: * Visits the given type-specific AST node.
0639: * <p>
0640: * The default implementation does nothing and return true.
0641: * Subclasses may reimplement.
0642: * </p>
0643: *
0644: * @param node the node to visit
0645: * @return <code>true</code> if the children of this node should be
0646: * visited, and <code>false</code> if the children of this node should
0647: * be skipped
0648: */
0649: public boolean visit(ForStatement node) {
0650: return true;
0651: }
0652:
0653: /**
0654: * Visits the given type-specific AST node.
0655: * <p>
0656: * The default implementation does nothing and return true.
0657: * Subclasses may reimplement.
0658: * </p>
0659: *
0660: * @param node the node to visit
0661: * @return <code>true</code> if the children of this node should be
0662: * visited, and <code>false</code> if the children of this node should
0663: * be skipped
0664: */
0665: public boolean visit(IfStatement node) {
0666: return true;
0667: }
0668:
0669: /**
0670: * Visits the given type-specific AST node.
0671: * <p>
0672: * The default implementation does nothing and return true.
0673: * Subclasses may reimplement.
0674: * </p>
0675: *
0676: * @param node the node to visit
0677: * @return <code>true</code> if the children of this node should be
0678: * visited, and <code>false</code> if the children of this node should
0679: * be skipped
0680: */
0681: public boolean visit(ImportDeclaration node) {
0682: return true;
0683: }
0684:
0685: /**
0686: * Visits the given type-specific AST node.
0687: * <p>
0688: * The default implementation does nothing and return true.
0689: * Subclasses may reimplement.
0690: * </p>
0691: *
0692: * @param node the node to visit
0693: * @return <code>true</code> if the children of this node should be
0694: * visited, and <code>false</code> if the children of this node should
0695: * be skipped
0696: */
0697: public boolean visit(InfixExpression node) {
0698: return true;
0699: }
0700:
0701: /**
0702: * Visits the given type-specific AST node.
0703: * <p>
0704: * The default implementation does nothing and return true.
0705: * Subclasses may reimplement.
0706: * </p>
0707: *
0708: * @param node the node to visit
0709: * @return <code>true</code> if the children of this node should be
0710: * visited, and <code>false</code> if the children of this node should
0711: * be skipped
0712: */
0713: public boolean visit(InstanceofExpression node) {
0714: return true;
0715: }
0716:
0717: /**
0718: * Visits the given type-specific AST node.
0719: * <p>
0720: * The default implementation does nothing and return true.
0721: * Subclasses may reimplement.
0722: * </p>
0723: *
0724: * @param node the node to visit
0725: * @return <code>true</code> if the children of this node should be
0726: * visited, and <code>false</code> if the children of this node should
0727: * be skipped
0728: */
0729: public boolean visit(Initializer node) {
0730: return true;
0731: }
0732:
0733: /**
0734: * Visits the given AST node.
0735: * <p>
0736: * Unlike other node types, the boolean returned by the default
0737: * implementation is controlled by a constructor-supplied
0738: * parameter {@link #ASTVisitor(boolean) ASTVisitor(boolean)}
0739: * which is <code>false</code> by default.
0740: * Subclasses may reimplement.
0741: * </p>
0742: *
0743: * @param node the node to visit
0744: * @return <code>true</code> if the children of this node should be
0745: * visited, and <code>false</code> if the children of this node should
0746: * be skipped
0747: * @see #ASTVisitor()
0748: * @see #ASTVisitor(boolean)
0749: */
0750: public boolean visit(Javadoc node) {
0751: // visit tag elements inside doc comments only if requested
0752: return this .visitDocTags;
0753: }
0754:
0755: /**
0756: * Visits the given type-specific AST node.
0757: * <p>
0758: * The default implementation does nothing and return true.
0759: * Subclasses may reimplement.
0760: * </p>
0761: *
0762: * @param node the node to visit
0763: * @return <code>true</code> if the children of this node should be
0764: * visited, and <code>false</code> if the children of this node should
0765: * be skipped
0766: */
0767: public boolean visit(LabeledStatement node) {
0768: return true;
0769: }
0770:
0771: /**
0772: * Visits the given type-specific AST node.
0773: * <p>
0774: * The default implementation does nothing and return true.
0775: * Subclasses may reimplement.
0776: * </p>
0777: * <p>Note: {@link LineComment} and {@link BlockComment} nodes are
0778: * not considered part of main structure of the AST. This method will
0779: * only be called if a client goes out of their way to visit this
0780: * kind of node explicitly.
0781: * </p>
0782: *
0783: * @param node the node to visit
0784: * @return <code>true</code> if the children of this node should be
0785: * visited, and <code>false</code> if the children of this node should
0786: * be skipped
0787: * @since 3.0
0788: */
0789: public boolean visit(LineComment node) {
0790: return true;
0791: }
0792:
0793: /**
0794: * Visits the given type-specific AST node.
0795: * <p>
0796: * The default implementation does nothing and return true.
0797: * Subclasses may reimplement.
0798: * </p>
0799: *
0800: * @param node the node to visit
0801: * @return <code>true</code> if the children of this node should be
0802: * visited, and <code>false</code> if the children of this node should
0803: * be skipped
0804: * @since 3.1
0805: */
0806: public boolean visit(MarkerAnnotation node) {
0807: return true;
0808: }
0809:
0810: /**
0811: * Visits the given type-specific AST node.
0812: * <p>
0813: * The default implementation does nothing and return true.
0814: * Subclasses may reimplement.
0815: * </p>
0816: *
0817: * @param node the node to visit
0818: * @return <code>true</code> if the children of this node should be
0819: * visited, and <code>false</code> if the children of this node should
0820: * be skipped
0821: * @since 3.0
0822: */
0823: public boolean visit(MemberRef node) {
0824: return true;
0825: }
0826:
0827: /**
0828: * Visits the given type-specific AST node.
0829: * <p>
0830: * The default implementation does nothing and return true.
0831: * Subclasses may reimplement.
0832: * </p>
0833: *
0834: * @param node the node to visit
0835: * @return <code>true</code> if the children of this node should be
0836: * visited, and <code>false</code> if the children of this node should
0837: * be skipped
0838: * @since 3.1
0839: */
0840: public boolean visit(MemberValuePair node) {
0841: return true;
0842: }
0843:
0844: /**
0845: * Visits the given type-specific AST node.
0846: * <p>
0847: * The default implementation does nothing and return true.
0848: * Subclasses may reimplement.
0849: * </p>
0850: *
0851: * @param node the node to visit
0852: * @return <code>true</code> if the children of this node should be
0853: * visited, and <code>false</code> if the children of this node should
0854: * be skipped
0855: * @since 3.0
0856: */
0857: public boolean visit(MethodRef node) {
0858: return true;
0859: }
0860:
0861: /**
0862: * Visits the given type-specific AST node.
0863: * <p>
0864: * The default implementation does nothing and return true.
0865: * Subclasses may reimplement.
0866: * </p>
0867: *
0868: * @param node the node to visit
0869: * @return <code>true</code> if the children of this node should be
0870: * visited, and <code>false</code> if the children of this node should
0871: * be skipped
0872: * @since 3.0
0873: */
0874: public boolean visit(MethodRefParameter node) {
0875: return true;
0876: }
0877:
0878: /**
0879: * Visits the given type-specific AST node.
0880: * <p>
0881: * The default implementation does nothing and return true.
0882: * Subclasses may reimplement.
0883: * </p>
0884: *
0885: * @param node the node to visit
0886: * @return <code>true</code> if the children of this node should be
0887: * visited, and <code>false</code> if the children of this node should
0888: * be skipped
0889: */
0890: public boolean visit(MethodDeclaration node) {
0891: return true;
0892: }
0893:
0894: /**
0895: * Visits the given type-specific AST node.
0896: * <p>
0897: * The default implementation does nothing and return true.
0898: * Subclasses may reimplement.
0899: * </p>
0900: *
0901: * @param node the node to visit
0902: * @return <code>true</code> if the children of this node should be
0903: * visited, and <code>false</code> if the children of this node should
0904: * be skipped
0905: */
0906: public boolean visit(MethodInvocation node) {
0907: return true;
0908: }
0909:
0910: /**
0911: * Visits the given type-specific AST node.
0912: * <p>
0913: * The default implementation does nothing and return true.
0914: * Subclasses may reimplement.
0915: * </p>
0916: *
0917: * @param node the node to visit
0918: * @return <code>true</code> if the children of this node should be
0919: * visited, and <code>false</code> if the children of this node should
0920: * be skipped
0921: * @since 3.1
0922: */
0923: public boolean visit(Modifier node) {
0924: return true;
0925: }
0926:
0927: /**
0928: * Visits the given type-specific AST node.
0929: * <p>
0930: * The default implementation does nothing and return true.
0931: * Subclasses may reimplement.
0932: * </p>
0933: *
0934: * @param node the node to visit
0935: * @return <code>true</code> if the children of this node should be
0936: * visited, and <code>false</code> if the children of this node should
0937: * be skipped
0938: * @since 3.1
0939: */
0940: public boolean visit(NormalAnnotation node) {
0941: return true;
0942: }
0943:
0944: /**
0945: * Visits the given type-specific AST node.
0946: * <p>
0947: * The default implementation does nothing and return true.
0948: * Subclasses may reimplement.
0949: * </p>
0950: *
0951: * @param node the node to visit
0952: * @return <code>true</code> if the children of this node should be
0953: * visited, and <code>false</code> if the children of this node should
0954: * be skipped
0955: */
0956: public boolean visit(NullLiteral node) {
0957: return true;
0958: }
0959:
0960: /**
0961: * Visits the given type-specific AST node.
0962: * <p>
0963: * The default implementation does nothing and return true.
0964: * Subclasses may reimplement.
0965: * </p>
0966: *
0967: * @param node the node to visit
0968: * @return <code>true</code> if the children of this node should be
0969: * visited, and <code>false</code> if the children of this node should
0970: * be skipped
0971: */
0972: public boolean visit(NumberLiteral node) {
0973: return true;
0974: }
0975:
0976: /**
0977: * Visits the given type-specific AST node.
0978: * <p>
0979: * The default implementation does nothing and return true.
0980: * Subclasses may reimplement.
0981: * </p>
0982: *
0983: * @param node the node to visit
0984: * @return <code>true</code> if the children of this node should be
0985: * visited, and <code>false</code> if the children of this node should
0986: * be skipped
0987: */
0988: public boolean visit(PackageDeclaration node) {
0989: return true;
0990: }
0991:
0992: /**
0993: * Visits the given type-specific AST node.
0994: * <p>
0995: * The default implementation does nothing and return true.
0996: * Subclasses may reimplement.
0997: * </p>
0998: *
0999: * @param node the node to visit
1000: * @return <code>true</code> if the children of this node should be
1001: * visited, and <code>false</code> if the children of this node should
1002: * be skipped
1003: * @since 3.1
1004: */
1005: public boolean visit(ParameterizedType node) {
1006: return true;
1007: }
1008:
1009: /**
1010: * Visits the given type-specific AST node.
1011: * <p>
1012: * The default implementation does nothing and return true.
1013: * Subclasses may reimplement.
1014: * </p>
1015: *
1016: * @param node the node to visit
1017: * @return <code>true</code> if the children of this node should be
1018: * visited, and <code>false</code> if the children of this node should
1019: * be skipped
1020: */
1021: public boolean visit(ParenthesizedExpression node) {
1022: return true;
1023: }
1024:
1025: /**
1026: * Visits the given type-specific AST node.
1027: * <p>
1028: * The default implementation does nothing and return true.
1029: * Subclasses may reimplement.
1030: * </p>
1031: *
1032: * @param node the node to visit
1033: * @return <code>true</code> if the children of this node should be
1034: * visited, and <code>false</code> if the children of this node should
1035: * be skipped
1036: */
1037: public boolean visit(PostfixExpression node) {
1038: return true;
1039: }
1040:
1041: /**
1042: * Visits the given type-specific AST node.
1043: * <p>
1044: * The default implementation does nothing and return true.
1045: * Subclasses may reimplement.
1046: * </p>
1047: *
1048: * @param node the node to visit
1049: * @return <code>true</code> if the children of this node should be
1050: * visited, and <code>false</code> if the children of this node should
1051: * be skipped
1052: */
1053: public boolean visit(PrefixExpression node) {
1054: return true;
1055: }
1056:
1057: /**
1058: * Visits the given type-specific AST node.
1059: * <p>
1060: * The default implementation does nothing and return true.
1061: * Subclasses may reimplement.
1062: * </p>
1063: *
1064: * @param node the node to visit
1065: * @return <code>true</code> if the children of this node should be
1066: * visited, and <code>false</code> if the children of this node should
1067: * be skipped
1068: */
1069: public boolean visit(PrimitiveType node) {
1070: return true;
1071: }
1072:
1073: /**
1074: * Visits the given type-specific AST node.
1075: * <p>
1076: * The default implementation does nothing and return true.
1077: * Subclasses may reimplement.
1078: * </p>
1079: *
1080: * @param node the node to visit
1081: * @return <code>true</code> if the children of this node should be
1082: * visited, and <code>false</code> if the children of this node should
1083: * be skipped
1084: */
1085: public boolean visit(QualifiedName node) {
1086: return true;
1087: }
1088:
1089: /**
1090: * Visits the given type-specific AST node.
1091: * <p>
1092: * The default implementation does nothing and return true.
1093: * Subclasses may reimplement.
1094: * </p>
1095: *
1096: * @param node the node to visit
1097: * @return <code>true</code> if the children of this node should be
1098: * visited, and <code>false</code> if the children of this node should
1099: * be skipped
1100: * @since 3.1
1101: */
1102: public boolean visit(QualifiedType node) {
1103: return true;
1104: }
1105:
1106: /**
1107: * Visits the given type-specific AST node.
1108: * <p>
1109: * The default implementation does nothing and return true.
1110: * Subclasses may reimplement.
1111: * </p>
1112: *
1113: * @param node the node to visit
1114: * @return <code>true</code> if the children of this node should be
1115: * visited, and <code>false</code> if the children of this node should
1116: * be skipped
1117: */
1118: public boolean visit(ReturnStatement node) {
1119: return true;
1120: }
1121:
1122: /**
1123: * Visits the given type-specific AST node.
1124: * <p>
1125: * The default implementation does nothing and return true.
1126: * Subclasses may reimplement.
1127: * </p>
1128: *
1129: * @param node the node to visit
1130: * @return <code>true</code> if the children of this node should be
1131: * visited, and <code>false</code> if the children of this node should
1132: * be skipped
1133: */
1134: public boolean visit(SimpleName node) {
1135: return true;
1136: }
1137:
1138: /**
1139: * Visits the given type-specific AST node.
1140: * <p>
1141: * The default implementation does nothing and return true.
1142: * Subclasses may reimplement.
1143: * </p>
1144: *
1145: * @param node the node to visit
1146: * @return <code>true</code> if the children of this node should be
1147: * visited, and <code>false</code> if the children of this node should
1148: * be skipped
1149: */
1150: public boolean visit(SimpleType node) {
1151: return true;
1152: }
1153:
1154: /**
1155: * Visits the given type-specific AST node.
1156: * <p>
1157: * The default implementation does nothing and return true.
1158: * Subclasses may reimplement.
1159: * </p>
1160: *
1161: * @param node the node to visit
1162: * @return <code>true</code> if the children of this node should be
1163: * visited, and <code>false</code> if the children of this node should
1164: * be skipped
1165: * @since 3.1
1166: */
1167: public boolean visit(SingleMemberAnnotation node) {
1168: return true;
1169: }
1170:
1171: /**
1172: * Visits the given type-specific AST node.
1173: * <p>
1174: * The default implementation does nothing and return true.
1175: * Subclasses may reimplement.
1176: * </p>
1177: *
1178: * @param node the node to visit
1179: * @return <code>true</code> if the children of this node should be
1180: * visited, and <code>false</code> if the children of this node should
1181: * be skipped
1182: */
1183: public boolean visit(SingleVariableDeclaration node) {
1184: return true;
1185: }
1186:
1187: /**
1188: * Visits the given type-specific AST node.
1189: * <p>
1190: * The default implementation does nothing and return true.
1191: * Subclasses may reimplement.
1192: * </p>
1193: *
1194: * @param node the node to visit
1195: * @return <code>true</code> if the children of this node should be
1196: * visited, and <code>false</code> if the children of this node should
1197: * be skipped
1198: */
1199: public boolean visit(StringLiteral node) {
1200: return true;
1201: }
1202:
1203: /**
1204: * Visits the given type-specific AST node.
1205: * <p>
1206: * The default implementation does nothing and return true.
1207: * Subclasses may reimplement.
1208: * </p>
1209: *
1210: * @param node the node to visit
1211: * @return <code>true</code> if the children of this node should be
1212: * visited, and <code>false</code> if the children of this node should
1213: * be skipped
1214: */
1215: public boolean visit(SuperConstructorInvocation node) {
1216: return true;
1217: }
1218:
1219: /**
1220: * Visits the given type-specific AST node.
1221: * <p>
1222: * The default implementation does nothing and return true.
1223: * Subclasses may reimplement.
1224: * </p>
1225: *
1226: * @param node the node to visit
1227: * @return <code>true</code> if the children of this node should be
1228: * visited, and <code>false</code> if the children of this node should
1229: * be skipped
1230: */
1231: public boolean visit(SuperFieldAccess node) {
1232: return true;
1233: }
1234:
1235: /**
1236: * Visits the given type-specific AST node.
1237: * <p>
1238: * The default implementation does nothing and return true.
1239: * Subclasses may reimplement.
1240: * </p>
1241: *
1242: * @param node the node to visit
1243: * @return <code>true</code> if the children of this node should be
1244: * visited, and <code>false</code> if the children of this node should
1245: * be skipped
1246: */
1247: public boolean visit(SuperMethodInvocation node) {
1248: return true;
1249: }
1250:
1251: /**
1252: * Visits the given type-specific AST node.
1253: * <p>
1254: * The default implementation does nothing and return true.
1255: * Subclasses may reimplement.
1256: * </p>
1257: *
1258: * @param node the node to visit
1259: * @return <code>true</code> if the children of this node should be
1260: * visited, and <code>false</code> if the children of this node should
1261: * be skipped
1262: */
1263: public boolean visit(SwitchCase node) {
1264: return true;
1265: }
1266:
1267: /**
1268: * Visits the given type-specific AST node.
1269: * <p>
1270: * The default implementation does nothing and return true.
1271: * Subclasses may reimplement.
1272: * </p>
1273: *
1274: * @param node the node to visit
1275: * @return <code>true</code> if the children of this node should be
1276: * visited, and <code>false</code> if the children of this node should
1277: * be skipped
1278: */
1279: public boolean visit(SwitchStatement node) {
1280: return true;
1281: }
1282:
1283: /**
1284: * Visits the given type-specific AST node.
1285: * <p>
1286: * The default implementation does nothing and return true.
1287: * Subclasses may reimplement.
1288: * </p>
1289: *
1290: * @param node the node to visit
1291: * @return <code>true</code> if the children of this node should be
1292: * visited, and <code>false</code> if the children of this node should
1293: * be skipped
1294: */
1295: public boolean visit(SynchronizedStatement node) {
1296: return true;
1297: }
1298:
1299: /**
1300: * Visits the given type-specific AST node.
1301: * <p>
1302: * The default implementation does nothing and return true.
1303: * Subclasses may reimplement.
1304: * </p>
1305: *
1306: * @param node the node to visit
1307: * @return <code>true</code> if the children of this node should be
1308: * visited, and <code>false</code> if the children of this node should
1309: * be skipped
1310: * @since 3.0
1311: */
1312: public boolean visit(TagElement node) {
1313: return true;
1314: }
1315:
1316: /**
1317: * Visits the given type-specific AST node.
1318: * <p>
1319: * The default implementation does nothing and return true.
1320: * Subclasses may reimplement.
1321: * </p>
1322: *
1323: * @param node the node to visit
1324: * @return <code>true</code> if the children of this node should be
1325: * visited, and <code>false</code> if the children of this node should
1326: * be skipped
1327: * @since 3.0
1328: */
1329: public boolean visit(TextElement node) {
1330: return true;
1331: }
1332:
1333: /**
1334: * Visits the given type-specific AST node.
1335: * <p>
1336: * The default implementation does nothing and return true.
1337: * Subclasses may reimplement.
1338: * </p>
1339: *
1340: * @param node the node to visit
1341: * @return <code>true</code> if the children of this node should be
1342: * visited, and <code>false</code> if the children of this node should
1343: * be skipped
1344: */
1345: public boolean visit(ThisExpression node) {
1346: return true;
1347: }
1348:
1349: /**
1350: * Visits the given type-specific AST node.
1351: * <p>
1352: * The default implementation does nothing and return true.
1353: * Subclasses may reimplement.
1354: * </p>
1355: *
1356: * @param node the node to visit
1357: * @return <code>true</code> if the children of this node should be
1358: * visited, and <code>false</code> if the children of this node should
1359: * be skipped
1360: */
1361: public boolean visit(ThrowStatement node) {
1362: return true;
1363: }
1364:
1365: /**
1366: * Visits the given type-specific AST node.
1367: * <p>
1368: * The default implementation does nothing and return true.
1369: * Subclasses may reimplement.
1370: * </p>
1371: *
1372: * @param node the node to visit
1373: * @return <code>true</code> if the children of this node should be
1374: * visited, and <code>false</code> if the children of this node should
1375: * be skipped
1376: */
1377: public boolean visit(TryStatement node) {
1378: return true;
1379: }
1380:
1381: /**
1382: * Visits the given type-specific AST node.
1383: * <p>
1384: * The default implementation does nothing and return true.
1385: * Subclasses may reimplement.
1386: * </p>
1387: *
1388: * @param node the node to visit
1389: * @return <code>true</code> if the children of this node should be
1390: * visited, and <code>false</code> if the children of this node should
1391: * be skipped
1392: */
1393: public boolean visit(TypeDeclaration node) {
1394: return true;
1395: }
1396:
1397: /**
1398: * Visits the given type-specific AST node.
1399: * <p>
1400: * The default implementation does nothing and return true.
1401: * Subclasses may reimplement.
1402: * </p>
1403: *
1404: * @param node the node to visit
1405: * @return <code>true</code> if the children of this node should be
1406: * visited, and <code>false</code> if the children of this node should
1407: * be skipped
1408: */
1409: public boolean visit(TypeDeclarationStatement node) {
1410: return true;
1411: }
1412:
1413: /**
1414: * Visits the given type-specific AST node.
1415: * <p>
1416: * The default implementation does nothing and return true.
1417: * Subclasses may reimplement.
1418: * </p>
1419: *
1420: * @param node the node to visit
1421: * @return <code>true</code> if the children of this node should be
1422: * visited, and <code>false</code> if the children of this node should
1423: * be skipped
1424: */
1425: public boolean visit(TypeLiteral node) {
1426: return true;
1427: }
1428:
1429: /**
1430: * Visits the given type-specific AST node.
1431: * <p>
1432: * The default implementation does nothing and return true.
1433: * Subclasses may reimplement.
1434: * </p>
1435: *
1436: * @param node the node to visit
1437: * @return <code>true</code> if the children of this node should be
1438: * visited, and <code>false</code> if the children of this node should
1439: * be skipped
1440: * @since 3.1
1441: */
1442: public boolean visit(TypeParameter node) {
1443: return true;
1444: }
1445:
1446: /**
1447: * Visits the given type-specific AST node.
1448: * <p>
1449: * The default implementation does nothing and return true.
1450: * Subclasses may reimplement.
1451: * </p>
1452: *
1453: * @param node the node to visit
1454: * @return <code>true</code> if the children of this node should be
1455: * visited, and <code>false</code> if the children of this node should
1456: * be skipped
1457: */
1458: public boolean visit(VariableDeclarationExpression node) {
1459: return true;
1460: }
1461:
1462: /**
1463: * Visits the given type-specific AST node.
1464: * <p>
1465: * The default implementation does nothing and return true.
1466: * Subclasses may reimplement.
1467: * </p>
1468: *
1469: * @param node the node to visit
1470: * @return <code>true</code> if the children of this node should be
1471: * visited, and <code>false</code> if the children of this node should
1472: * be skipped
1473: */
1474: public boolean visit(VariableDeclarationStatement node) {
1475: return true;
1476: }
1477:
1478: /**
1479: * Visits the given type-specific AST node.
1480: * <p>
1481: * The default implementation does nothing and return true.
1482: * Subclasses may reimplement.
1483: * </p>
1484: *
1485: * @param node the node to visit
1486: * @return <code>true</code> if the children of this node should be
1487: * visited, and <code>false</code> if the children of this node should
1488: * be skipped
1489: */
1490: public boolean visit(VariableDeclarationFragment node) {
1491: return true;
1492: }
1493:
1494: /**
1495: * Visits the given type-specific AST node.
1496: * <p>
1497: * The default implementation does nothing and return true.
1498: * Subclasses may reimplement.
1499: * </p>
1500: *
1501: * @param node the node to visit
1502: * @return <code>true</code> if the children of this node should be
1503: * visited, and <code>false</code> if the children of this node should
1504: * be skipped
1505: */
1506: public boolean visit(WhileStatement node) {
1507: return true;
1508: }
1509:
1510: /**
1511: * Visits the given type-specific AST node.
1512: * <p>
1513: * The default implementation does nothing and return true.
1514: * Subclasses may reimplement.
1515: * </p>
1516: *
1517: * @param node the node to visit
1518: * @return <code>true</code> if the children of this node should be
1519: * visited, and <code>false</code> if the children of this node should
1520: * be skipped
1521: * @since 3.1
1522: */
1523: public boolean visit(WildcardType node) {
1524: return true;
1525: }
1526:
1527: /**
1528: * End of visit the given type-specific AST node.
1529: * <p>
1530: * The default implementation does nothing. Subclasses may reimplement.
1531: * </p>
1532: *
1533: * @param node the node to visit
1534: * @since 3.1
1535: */
1536: public void endVisit(AnnotationTypeDeclaration node) {
1537: // default implementation: do nothing
1538: }
1539:
1540: /**
1541: * End of visit the given type-specific AST node.
1542: * <p>
1543: * The default implementation does nothing. Subclasses may reimplement.
1544: * </p>
1545: *
1546: * @param node the node to visit
1547: * @since 3.1
1548: */
1549: public void endVisit(AnnotationTypeMemberDeclaration node) {
1550: // default implementation: do nothing
1551: }
1552:
1553: /**
1554: * End of visit the given type-specific AST node.
1555: * <p>
1556: * The default implementation does nothing. Subclasses may reimplement.
1557: * </p>
1558: *
1559: * @param node the node to visit
1560: */
1561: public void endVisit(AnonymousClassDeclaration node) {
1562: // default implementation: do nothing
1563: }
1564:
1565: /**
1566: * End of visit the given type-specific AST node.
1567: * <p>
1568: * The default implementation does nothing. Subclasses may reimplement.
1569: * </p>
1570: *
1571: * @param node the node to visit
1572: */
1573: public void endVisit(ArrayAccess node) {
1574: // default implementation: do nothing
1575: }
1576:
1577: /**
1578: * End of visit the given type-specific AST node.
1579: * <p>
1580: * The default implementation does nothing. Subclasses may reimplement.
1581: * </p>
1582: *
1583: * @param node the node to visit
1584: */
1585: public void endVisit(ArrayCreation node) {
1586: // default implementation: do nothing
1587: }
1588:
1589: /**
1590: * End of visit the given type-specific AST node.
1591: * <p>
1592: * The default implementation does nothing. Subclasses may reimplement.
1593: * </p>
1594: *
1595: * @param node the node to visit
1596: */
1597: public void endVisit(ArrayInitializer node) {
1598: // default implementation: do nothing
1599: }
1600:
1601: /**
1602: * End of visit the given type-specific AST node.
1603: * <p>
1604: * The default implementation does nothing. Subclasses may reimplement.
1605: * </p>
1606: *
1607: * @param node the node to visit
1608: */
1609: public void endVisit(ArrayType node) {
1610: // default implementation: do nothing
1611: }
1612:
1613: /**
1614: * End of visit the given type-specific AST node.
1615: * <p>
1616: * The default implementation does nothing. Subclasses may reimplement.
1617: * </p>
1618: *
1619: * @param node the node to visit
1620: */
1621: public void endVisit(AssertStatement node) {
1622: // default implementation: do nothing
1623: }
1624:
1625: /**
1626: * End of visit the given type-specific AST node.
1627: * <p>
1628: * The default implementation does nothing. Subclasses may reimplement.
1629: * </p>
1630: *
1631: * @param node the node to visit
1632: */
1633: public void endVisit(Assignment node) {
1634: // default implementation: do nothing
1635: }
1636:
1637: /**
1638: * End of visit the given type-specific AST node.
1639: * <p>
1640: * The default implementation does nothing. Subclasses may reimplement.
1641: * </p>
1642: *
1643: * @param node the node to visit
1644: */
1645: public void endVisit(Block node) {
1646: // default implementation: do nothing
1647: }
1648:
1649: /**
1650: * End of visit the given type-specific AST node.
1651: * <p>
1652: * The default implementation does nothing. Subclasses may reimplement.
1653: * </p>
1654: * <p>Note: {@link LineComment} and {@link BlockComment} nodes are
1655: * not considered part of main structure of the AST. This method will
1656: * only be called if a client goes out of their way to visit this
1657: * kind of node explicitly.
1658: * </p>
1659: *
1660: * @param node the node to visit
1661: * @since 3.0
1662: */
1663: public void endVisit(BlockComment node) {
1664: // default implementation: do nothing
1665: }
1666:
1667: /**
1668: * End of visit the given type-specific AST node.
1669: * <p>
1670: * The default implementation does nothing. Subclasses may reimplement.
1671: * </p>
1672: *
1673: * @param node the node to visit
1674: */
1675: public void endVisit(BooleanLiteral node) {
1676: // default implementation: do nothing
1677: }
1678:
1679: /**
1680: * End of visit the given type-specific AST node.
1681: * <p>
1682: * The default implementation does nothing. Subclasses may reimplement.
1683: * </p>
1684: *
1685: * @param node the node to visit
1686: */
1687: public void endVisit(BreakStatement node) {
1688: // default implementation: do nothing
1689: }
1690:
1691: /**
1692: * End of visit the given type-specific AST node.
1693: * <p>
1694: * The default implementation does nothing. Subclasses may reimplement.
1695: * </p>
1696: *
1697: * @param node the node to visit
1698: */
1699: public void endVisit(CastExpression node) {
1700: // default implementation: do nothing
1701: }
1702:
1703: /**
1704: * End of visit the given type-specific AST node.
1705: * <p>
1706: * The default implementation does nothing. Subclasses may reimplement.
1707: * </p>
1708: *
1709: * @param node the node to visit
1710: */
1711: public void endVisit(CatchClause node) {
1712: // default implementation: do nothing
1713: }
1714:
1715: /**
1716: * End of visit the given type-specific AST node.
1717: * <p>
1718: * The default implementation does nothing. Subclasses may reimplement.
1719: * </p>
1720: *
1721: * @param node the node to visit
1722: */
1723: public void endVisit(CharacterLiteral node) {
1724: // default implementation: do nothing
1725: }
1726:
1727: /**
1728: * End of visit the given type-specific AST node.
1729: * <p>
1730: * The default implementation does nothing. Subclasses may reimplement.
1731: * </p>
1732: *
1733: * @param node the node to visit
1734: */
1735: public void endVisit(ClassInstanceCreation node) {
1736: // default implementation: do nothing
1737: }
1738:
1739: /**
1740: * End of visit the given type-specific AST node.
1741: * <p>
1742: * The default implementation does nothing. Subclasses may reimplement.
1743: * </p>
1744: *
1745: * @param node the node to visit
1746: */
1747: public void endVisit(CompilationUnit node) {
1748: // default implementation: do nothing
1749: }
1750:
1751: /**
1752: * End of visit the given type-specific AST node.
1753: * <p>
1754: * The default implementation does nothing. Subclasses may reimplement.
1755: * </p>
1756: *
1757: * @param node the node to visit
1758: */
1759: public void endVisit(ConditionalExpression node) {
1760: // default implementation: do nothing
1761: }
1762:
1763: /**
1764: * End of visit the given type-specific AST node.
1765: * <p>
1766: * The default implementation does nothing. Subclasses may reimplement.
1767: * </p>
1768: *
1769: * @param node the node to visit
1770: */
1771: public void endVisit(ConstructorInvocation node) {
1772: // default implementation: do nothing
1773: }
1774:
1775: /**
1776: * End of visit the given type-specific AST node.
1777: * <p>
1778: * The default implementation does nothing. Subclasses may reimplement.
1779: * </p>
1780: *
1781: * @param node the node to visit
1782: */
1783: public void endVisit(ContinueStatement node) {
1784: // default implementation: do nothing
1785: }
1786:
1787: /**
1788: * End of visit the given type-specific AST node.
1789: * <p>
1790: * The default implementation does nothing. Subclasses may reimplement.
1791: * </p>
1792: *
1793: * @param node the node to visit
1794: */
1795: public void endVisit(DoStatement node) {
1796: // default implementation: do nothing
1797: }
1798:
1799: /**
1800: * End of visit the given type-specific AST node.
1801: * <p>
1802: * The default implementation does nothing. Subclasses may reimplement.
1803: * </p>
1804: *
1805: * @param node the node to visit
1806: */
1807: public void endVisit(EmptyStatement node) {
1808: // default implementation: do nothing
1809: }
1810:
1811: /**
1812: * End of visit the given type-specific AST node.
1813: * <p>
1814: * The default implementation does nothing. Subclasses may reimplement.
1815: * </p>
1816: *
1817: * @param node the node to visit
1818: * @since 3.1
1819: */
1820: public void endVisit(EnhancedForStatement node) {
1821: // default implementation: do nothing
1822: }
1823:
1824: /**
1825: * End of visit the given type-specific AST node.
1826: * <p>
1827: * The default implementation does nothing. Subclasses may reimplement.
1828: * </p>
1829: *
1830: * @param node the node to visit
1831: * @since 3.1
1832: */
1833: public void endVisit(EnumConstantDeclaration node) {
1834: // default implementation: do nothing
1835: }
1836:
1837: /**
1838: * End of visit the given type-specific AST node.
1839: * <p>
1840: * The default implementation does nothing. Subclasses may reimplement.
1841: * </p>
1842: *
1843: * @param node the node to visit
1844: * @since 3.1
1845: */
1846: public void endVisit(EnumDeclaration node) {
1847: // default implementation: do nothing
1848: }
1849:
1850: /**
1851: * End of visit the given type-specific AST node.
1852: * <p>
1853: * The default implementation does nothing. Subclasses may reimplement.
1854: * </p>
1855: *
1856: * @param node the node to visit
1857: */
1858: public void endVisit(ExpressionStatement node) {
1859: // default implementation: do nothing
1860: }
1861:
1862: /**
1863: * End of visit the given type-specific AST node.
1864: * <p>
1865: * The default implementation does nothing. Subclasses may reimplement.
1866: * </p>
1867: *
1868: * @param node the node to visit
1869: */
1870: public void endVisit(FieldAccess node) {
1871: // default implementation: do nothing
1872: }
1873:
1874: /**
1875: * End of visit the given type-specific AST node.
1876: * <p>
1877: * The default implementation does nothing. Subclasses may reimplement.
1878: * </p>
1879: *
1880: * @param node the node to visit
1881: */
1882: public void endVisit(FieldDeclaration node) {
1883: // default implementation: do nothing
1884: }
1885:
1886: /**
1887: * End of visit the given type-specific AST node.
1888: * <p>
1889: * The default implementation does nothing. Subclasses may reimplement.
1890: * </p>
1891: *
1892: * @param node the node to visit
1893: */
1894: public void endVisit(ForStatement node) {
1895: // default implementation: do nothing
1896: }
1897:
1898: /**
1899: * End of visit the given type-specific AST node.
1900: * <p>
1901: * The default implementation does nothing. Subclasses may reimplement.
1902: * </p>
1903: *
1904: * @param node the node to visit
1905: */
1906: public void endVisit(IfStatement node) {
1907: // default implementation: do nothing
1908: }
1909:
1910: /**
1911: * End of visit the given type-specific AST node.
1912: * <p>
1913: * The default implementation does nothing. Subclasses may reimplement.
1914: * </p>
1915: *
1916: * @param node the node to visit
1917: */
1918: public void endVisit(ImportDeclaration node) {
1919: // default implementation: do nothing
1920: }
1921:
1922: /**
1923: * End of visit the given type-specific AST node.
1924: * <p>
1925: * The default implementation does nothing. Subclasses may reimplement.
1926: * </p>
1927: *
1928: * @param node the node to visit
1929: */
1930: public void endVisit(InfixExpression node) {
1931: // default implementation: do nothing
1932: }
1933:
1934: /**
1935: * End of visit the given type-specific AST node.
1936: * <p>
1937: * The default implementation does nothing. Subclasses may reimplement.
1938: * </p>
1939: *
1940: * @param node the node to visit
1941: */
1942: public void endVisit(InstanceofExpression node) {
1943: // default implementation: do nothing
1944: }
1945:
1946: /**
1947: * End of visit the given type-specific AST node.
1948: * <p>
1949: * The default implementation does nothing. Subclasses may reimplement.
1950: * </p>
1951: *
1952: * @param node the node to visit
1953: */
1954: public void endVisit(Initializer node) {
1955: // default implementation: do nothing
1956: }
1957:
1958: /**
1959: * End of visit the given type-specific AST node.
1960: * <p>
1961: * The default implementation does nothing. Subclasses may reimplement.
1962: * </p>
1963: *
1964: * @param node the node to visit
1965: */
1966: public void endVisit(Javadoc node) {
1967: // default implementation: do nothing
1968: }
1969:
1970: /**
1971: * End of visit the given type-specific AST node.
1972: * <p>
1973: * The default implementation does nothing. Subclasses may reimplement.
1974: * </p>
1975: *
1976: * @param node the node to visit
1977: */
1978: public void endVisit(LabeledStatement node) {
1979: // default implementation: do nothing
1980: }
1981:
1982: /**
1983: * End of visit the given type-specific AST node.
1984: * <p>
1985: * The default implementation does nothing. Subclasses may reimplement.
1986: * </p>
1987: * <p>Note: {@link LineComment} and {@link BlockComment} nodes are
1988: * not considered part of main structure of the AST. This method will
1989: * only be called if a client goes out of their way to visit this
1990: * kind of node explicitly.
1991: * </p>
1992: *
1993: * @param node the node to visit
1994: * @since 3.0
1995: */
1996: public void endVisit(LineComment node) {
1997: // default implementation: do nothing
1998: }
1999:
2000: /**
2001: * End of visit the given type-specific AST node.
2002: * <p>
2003: * The default implementation does nothing. Subclasses may reimplement.
2004: * </p>
2005: *
2006: * @param node the node to visit
2007: * @since 3.1
2008: */
2009: public void endVisit(MarkerAnnotation node) {
2010: // default implementation: do nothing
2011: }
2012:
2013: /**
2014: * End of visit the given type-specific AST node.
2015: * <p>
2016: * The default implementation does nothing. Subclasses may reimplement.
2017: * </p>
2018: *
2019: * @param node the node to visit
2020: * @since 3.0
2021: */
2022: public void endVisit(MemberRef node) {
2023: // default implementation: do nothing
2024: }
2025:
2026: /**
2027: * End of visit the given type-specific AST node.
2028: * <p>
2029: * The default implementation does nothing. Subclasses may reimplement.
2030: * </p>
2031: *
2032: * @param node the node to visit
2033: * @since 3.1
2034: */
2035: public void endVisit(MemberValuePair node) {
2036: // default implementation: do nothing
2037: }
2038:
2039: /**
2040: * End of visit the given type-specific AST node.
2041: * <p>
2042: * The default implementation does nothing. Subclasses may reimplement.
2043: * </p>
2044: *
2045: * @param node the node to visit
2046: * @since 3.0
2047: */
2048: public void endVisit(MethodRef node) {
2049: // default implementation: do nothing
2050: }
2051:
2052: /**
2053: * End of visit the given type-specific AST node.
2054: * <p>
2055: * The default implementation does nothing. Subclasses may reimplement.
2056: * </p>
2057: *
2058: * @param node the node to visit
2059: * @since 3.0
2060: */
2061: public void endVisit(MethodRefParameter node) {
2062: // default implementation: do nothing
2063: }
2064:
2065: /**
2066: * End of visit the given type-specific AST node.
2067: * <p>
2068: * The default implementation does nothing. Subclasses may reimplement.
2069: * </p>
2070: *
2071: * @param node the node to visit
2072: */
2073: public void endVisit(MethodDeclaration node) {
2074: // default implementation: do nothing
2075: }
2076:
2077: /**
2078: * End of visit the given type-specific AST node.
2079: * <p>
2080: * The default implementation does nothing. Subclasses may reimplement.
2081: * </p>
2082: *
2083: * @param node the node to visit
2084: */
2085: public void endVisit(MethodInvocation node) {
2086: // default implementation: do nothing
2087: }
2088:
2089: /**
2090: * End of visit the given type-specific AST node.
2091: * <p>
2092: * The default implementation does nothing. Subclasses may reimplement.
2093: * </p>
2094: *
2095: * @param node the node to visit
2096: * @since 3.1
2097: */
2098: public void endVisit(Modifier node) {
2099: // default implementation: do nothing
2100: }
2101:
2102: /**
2103: * End of visit the given type-specific AST node.
2104: * <p>
2105: * The default implementation does nothing. Subclasses may reimplement.
2106: * </p>
2107: *
2108: * @param node the node to visit
2109: * @since 3.1
2110: */
2111: public void endVisit(NormalAnnotation node) {
2112: // default implementation: do nothing
2113: }
2114:
2115: /**
2116: * End of visit the given type-specific AST node.
2117: * <p>
2118: * The default implementation does nothing. Subclasses may reimplement.
2119: * </p>
2120: *
2121: * @param node the node to visit
2122: */
2123: public void endVisit(NullLiteral node) {
2124: // default implementation: do nothing
2125: }
2126:
2127: /**
2128: * End of visit the given type-specific AST node.
2129: * <p>
2130: * The default implementation does nothing. Subclasses may reimplement.
2131: * </p>
2132: *
2133: * @param node the node to visit
2134: */
2135: public void endVisit(NumberLiteral node) {
2136: // default implementation: do nothing
2137: }
2138:
2139: /**
2140: * End of visit the given type-specific AST node.
2141: * <p>
2142: * The default implementation does nothing. Subclasses may reimplement.
2143: * </p>
2144: *
2145: * @param node the node to visit
2146: */
2147: public void endVisit(PackageDeclaration node) {
2148: // default implementation: do nothing
2149: }
2150:
2151: /**
2152: * End of visit the given type-specific AST node.
2153: * <p>
2154: * The default implementation does nothing. Subclasses may reimplement.
2155: * </p>
2156: *
2157: * @param node the node to visit
2158: * @since 3.1
2159: */
2160: public void endVisit(ParameterizedType node) {
2161: // default implementation: do nothing
2162: }
2163:
2164: /**
2165: * End of visit the given type-specific AST node.
2166: * <p>
2167: * The default implementation does nothing. Subclasses may reimplement.
2168: * </p>
2169: *
2170: * @param node the node to visit
2171: */
2172: public void endVisit(ParenthesizedExpression node) {
2173: // default implementation: do nothing
2174: }
2175:
2176: /**
2177: * End of visit the given type-specific AST node.
2178: * <p>
2179: * The default implementation does nothing. Subclasses may reimplement.
2180: * </p>
2181: *
2182: * @param node the node to visit
2183: */
2184: public void endVisit(PostfixExpression node) {
2185: // default implementation: do nothing
2186: }
2187:
2188: /**
2189: * End of visit the given type-specific AST node.
2190: * <p>
2191: * The default implementation does nothing. Subclasses may reimplement.
2192: * </p>
2193: *
2194: * @param node the node to visit
2195: */
2196: public void endVisit(PrefixExpression node) {
2197: // default implementation: do nothing
2198: }
2199:
2200: /**
2201: * End of visit the given type-specific AST node.
2202: * <p>
2203: * The default implementation does nothing. Subclasses may reimplement.
2204: * </p>
2205: *
2206: * @param node the node to visit
2207: */
2208: public void endVisit(PrimitiveType node) {
2209: // default implementation: do nothing
2210: }
2211:
2212: /**
2213: * End of visit the given type-specific AST node.
2214: * <p>
2215: * The default implementation does nothing. Subclasses may reimplement.
2216: * </p>
2217: *
2218: * @param node the node to visit
2219: */
2220: public void endVisit(QualifiedName node) {
2221: // default implementation: do nothing
2222: }
2223:
2224: /**
2225: * End of visit the given type-specific AST node.
2226: * <p>
2227: * The default implementation does nothing. Subclasses may reimplement.
2228: * </p>
2229: *
2230: * @param node the node to visit
2231: * @since 3.1
2232: */
2233: public void endVisit(QualifiedType node) {
2234: // default implementation: do nothing
2235: }
2236:
2237: /**
2238: * End of visit the given type-specific AST node.
2239: * <p>
2240: * The default implementation does nothing. Subclasses may reimplement.
2241: * </p>
2242: *
2243: * @param node the node to visit
2244: */
2245: public void endVisit(ReturnStatement node) {
2246: // default implementation: do nothing
2247: }
2248:
2249: /**
2250: * End of visit the given type-specific AST node.
2251: * <p>
2252: * The default implementation does nothing. Subclasses may reimplement.
2253: * </p>
2254: *
2255: * @param node the node to visit
2256: */
2257: public void endVisit(SimpleName node) {
2258: // default implementation: do nothing
2259: }
2260:
2261: /**
2262: * End of visit the given type-specific AST node.
2263: * <p>
2264: * The default implementation does nothing. Subclasses may reimplement.
2265: * </p>
2266: *
2267: * @param node the node to visit
2268: */
2269: public void endVisit(SimpleType node) {
2270: // default implementation: do nothing
2271: }
2272:
2273: /**
2274: * End of visit the given type-specific AST node.
2275: * <p>
2276: * The default implementation does nothing. Subclasses may reimplement.
2277: * </p>
2278: *
2279: * @param node the node to visit
2280: * @since 3.1
2281: */
2282: public void endVisit(SingleMemberAnnotation node) {
2283: // default implementation: do nothing
2284: }
2285:
2286: /**
2287: * End of visit the given type-specific AST node.
2288: * <p>
2289: * The default implementation does nothing. Subclasses may reimplement.
2290: * </p>
2291: *
2292: * @param node the node to visit
2293: */
2294: public void endVisit(SingleVariableDeclaration node) {
2295: // default implementation: do nothing
2296: }
2297:
2298: /**
2299: * End of visit the given type-specific AST node.
2300: * <p>
2301: * The default implementation does nothing. Subclasses may reimplement.
2302: * </p>
2303: *
2304: * @param node the node to visit
2305: */
2306: public void endVisit(StringLiteral node) {
2307: // default implementation: do nothing
2308: }
2309:
2310: /**
2311: * End of visit the given type-specific AST node.
2312: * <p>
2313: * The default implementation does nothing. Subclasses may reimplement.
2314: * </p>
2315: *
2316: * @param node the node to visit
2317: */
2318: public void endVisit(SuperConstructorInvocation node) {
2319: // default implementation: do nothing
2320: }
2321:
2322: /**
2323: * End of visit the given type-specific AST node.
2324: * <p>
2325: * The default implementation does nothing. Subclasses may reimplement.
2326: * </p>
2327: *
2328: * @param node the node to visit
2329: */
2330: public void endVisit(SuperFieldAccess node) {
2331: // default implementation: do nothing
2332: }
2333:
2334: /**
2335: * End of visit the given type-specific AST node.
2336: * <p>
2337: * The default implementation does nothing. Subclasses may reimplement.
2338: * </p>
2339: *
2340: * @param node the node to visit
2341: */
2342: public void endVisit(SuperMethodInvocation node) {
2343: // default implementation: do nothing
2344: }
2345:
2346: /**
2347: * End of visit the given type-specific AST node.
2348: * <p>
2349: * The default implementation does nothing. Subclasses may reimplement.
2350: * </p>
2351: *
2352: * @param node the node to visit
2353: */
2354: public void endVisit(SwitchCase node) {
2355: // default implementation: do nothing
2356: }
2357:
2358: /**
2359: * End of visit the given type-specific AST node.
2360: * <p>
2361: * The default implementation does nothing. Subclasses may reimplement.
2362: * </p>
2363: *
2364: * @param node the node to visit
2365: */
2366: public void endVisit(SwitchStatement node) {
2367: // default implementation: do nothing
2368: }
2369:
2370: /**
2371: * End of visit the given type-specific AST node.
2372: * <p>
2373: * The default implementation does nothing. Subclasses may reimplement.
2374: * </p>
2375: *
2376: * @param node the node to visit
2377: */
2378: public void endVisit(SynchronizedStatement node) {
2379: // default implementation: do nothing
2380: }
2381:
2382: /**
2383: * End of visit the given type-specific AST node.
2384: * <p>
2385: * The default implementation does nothing. Subclasses may reimplement.
2386: * </p>
2387: *
2388: * @param node the node to visit
2389: * @since 3.0
2390: */
2391: public void endVisit(TagElement node) {
2392: // default implementation: do nothing
2393: }
2394:
2395: /**
2396: * End of visit the given type-specific AST node.
2397: * <p>
2398: * The default implementation does nothing. Subclasses may reimplement.
2399: * </p>
2400: *
2401: * @param node the node to visit
2402: * @since 3.0
2403: */
2404: public void endVisit(TextElement node) {
2405: // default implementation: do nothing
2406: }
2407:
2408: /**
2409: * End of visit the given type-specific AST node.
2410: * <p>
2411: * The default implementation does nothing. Subclasses may reimplement.
2412: * </p>
2413: *
2414: * @param node the node to visit
2415: */
2416: public void endVisit(ThisExpression node) {
2417: // default implementation: do nothing
2418: }
2419:
2420: /**
2421: * End of visit the given type-specific AST node.
2422: * <p>
2423: * The default implementation does nothing. Subclasses may reimplement.
2424: * </p>
2425: *
2426: * @param node the node to visit
2427: */
2428: public void endVisit(ThrowStatement node) {
2429: // default implementation: do nothing
2430: }
2431:
2432: /**
2433: * End of visit the given type-specific AST node.
2434: * <p>
2435: * The default implementation does nothing. Subclasses may reimplement.
2436: * </p>
2437: *
2438: * @param node the node to visit
2439: */
2440: public void endVisit(TryStatement node) {
2441: // default implementation: do nothing
2442: }
2443:
2444: /**
2445: * End of visit the given type-specific AST node.
2446: * <p>
2447: * The default implementation does nothing. Subclasses may reimplement.
2448: * </p>
2449: *
2450: * @param node the node to visit
2451: */
2452: public void endVisit(TypeDeclaration node) {
2453: // default implementation: do nothing
2454: }
2455:
2456: /**
2457: * End of visit the given type-specific AST node.
2458: * <p>
2459: * The default implementation does nothing. Subclasses may reimplement.
2460: * </p>
2461: *
2462: * @param node the node to visit
2463: */
2464: public void endVisit(TypeDeclarationStatement node) {
2465: // default implementation: do nothing
2466: }
2467:
2468: /**
2469: * End of visit the given type-specific AST node.
2470: * <p>
2471: * The default implementation does nothing. Subclasses may reimplement.
2472: * </p>
2473: *
2474: * @param node the node to visit
2475: */
2476: public void endVisit(TypeLiteral node) {
2477: // default implementation: do nothing
2478: }
2479:
2480: /**
2481: * End of visit the given type-specific AST node.
2482: * <p>
2483: * The default implementation does nothing. Subclasses may reimplement.
2484: * </p>
2485: *
2486: * @param node the node to visit
2487: * @since 3.1
2488: */
2489: public void endVisit(TypeParameter node) {
2490: // default implementation: do nothing
2491: }
2492:
2493: /**
2494: * End of visit the given type-specific AST node.
2495: * <p>
2496: * The default implementation does nothing. Subclasses may reimplement.
2497: * </p>
2498: *
2499: * @param node the node to visit
2500: */
2501: public void endVisit(VariableDeclarationExpression node) {
2502: // default implementation: do nothing
2503: }
2504:
2505: /**
2506: * End of visit the given type-specific AST node.
2507: * <p>
2508: * The default implementation does nothing. Subclasses may reimplement.
2509: * </p>
2510: *
2511: * @param node the node to visit
2512: */
2513: public void endVisit(VariableDeclarationStatement node) {
2514: // default implementation: do nothing
2515: }
2516:
2517: /**
2518: * End of visit the given type-specific AST node.
2519: * <p>
2520: * The default implementation does nothing. Subclasses may reimplement.
2521: * </p>
2522: *
2523: * @param node the node to visit
2524: */
2525: public void endVisit(VariableDeclarationFragment node) {
2526: // default implementation: do nothing
2527: }
2528:
2529: /**
2530: * End of visit the given type-specific AST node.
2531: * <p>
2532: * The default implementation does nothing. Subclasses may reimplement.
2533: * </p>
2534: *
2535: * @param node the node to visit
2536: */
2537: public void endVisit(WhileStatement node) {
2538: // default implementation: do nothing
2539: }
2540:
2541: /**
2542: * End of visit the given type-specific AST node.
2543: * <p>
2544: * The default implementation does nothing. Subclasses may reimplement.
2545: * </p>
2546: *
2547: * @param node the node to visit
2548: * @since 3.1
2549: */
2550: public void endVisit(WildcardType node) {
2551: // default implementation: do nothing
2552: }
2553: }
|