Lombok - v0.10.8

lombok.javac
Interface JavacASTVisitor

All Known Implementing Classes:
HandleVal, JavacASTAdapter, JavacASTVisitor.Printer

public interface JavacASTVisitor

Implement so you can ask any JavacAST.LombokNode to traverse depth-first through all children, calling the appropriate visit and endVisit methods.


Nested Class Summary
static class JavacASTVisitor.Printer
          Prints the structure of an AST.
 
Method Summary
 void endVisitCompilationUnit(JavacNode top, com.sun.tools.javac.tree.JCTree.JCCompilationUnit unit)
           
 void endVisitField(JavacNode fieldNode, com.sun.tools.javac.tree.JCTree.JCVariableDecl field)
           
 void endVisitInitializer(JavacNode initializerNode, com.sun.tools.javac.tree.JCTree.JCBlock initializer)
           
 void endVisitLocal(JavacNode localNode, com.sun.tools.javac.tree.JCTree.JCVariableDecl local)
           
 void endVisitMethod(JavacNode methodNode, com.sun.tools.javac.tree.JCTree.JCMethodDecl method)
           
 void endVisitMethodArgument(JavacNode argumentNode, com.sun.tools.javac.tree.JCTree.JCVariableDecl argument, com.sun.tools.javac.tree.JCTree.JCMethodDecl method)
           
 void endVisitStatement(JavacNode statementNode, com.sun.tools.javac.tree.JCTree statement)
           
 void endVisitType(JavacNode typeNode, com.sun.tools.javac.tree.JCTree.JCClassDecl type)
           
 boolean isResolutionBased()
          If true, you'll be called after all the non-resolution based visitors.
 void visitAnnotationOnField(com.sun.tools.javac.tree.JCTree.JCVariableDecl field, JavacNode annotationNode, com.sun.tools.javac.tree.JCTree.JCAnnotation annotation)
           
 void visitAnnotationOnLocal(com.sun.tools.javac.tree.JCTree.JCVariableDecl local, JavacNode annotationNode, com.sun.tools.javac.tree.JCTree.JCAnnotation annotation)
           
 void visitAnnotationOnMethod(com.sun.tools.javac.tree.JCTree.JCMethodDecl method, JavacNode annotationNode, com.sun.tools.javac.tree.JCTree.JCAnnotation annotation)
           
 void visitAnnotationOnMethodArgument(com.sun.tools.javac.tree.JCTree.JCVariableDecl argument, com.sun.tools.javac.tree.JCTree.JCMethodDecl method, JavacNode annotationNode, com.sun.tools.javac.tree.JCTree.JCAnnotation annotation)
           
 void visitAnnotationOnType(com.sun.tools.javac.tree.JCTree.JCClassDecl type, JavacNode annotationNode, com.sun.tools.javac.tree.JCTree.JCAnnotation annotation)
           
 void visitCompilationUnit(JavacNode top, com.sun.tools.javac.tree.JCTree.JCCompilationUnit unit)
          Called at the very beginning and end.
 void visitField(JavacNode fieldNode, com.sun.tools.javac.tree.JCTree.JCVariableDecl field)
          Called when visiting a field of a class.
 void visitInitializer(JavacNode initializerNode, com.sun.tools.javac.tree.JCTree.JCBlock initializer)
          Called for static and instance initializers.
 void visitLocal(JavacNode localNode, com.sun.tools.javac.tree.JCTree.JCVariableDecl local)
          Visits a local declaration - that is, something like 'int x = 10;' on the method level.
 void visitMethod(JavacNode methodNode, com.sun.tools.javac.tree.JCTree.JCMethodDecl method)
          Called for both methods and constructors.
 void visitMethodArgument(JavacNode argumentNode, com.sun.tools.javac.tree.JCTree.JCVariableDecl argument, com.sun.tools.javac.tree.JCTree.JCMethodDecl method)
          Visits a method argument.
 void visitStatement(JavacNode statementNode, com.sun.tools.javac.tree.JCTree statement)
          Visits a statement that isn't any of the other visit methods (e.g.
 void visitType(JavacNode typeNode, com.sun.tools.javac.tree.JCTree.JCClassDecl type)
          Called when visiting a type (a class, interface, annotation, enum, etcetera).
 

Method Detail

isResolutionBased

boolean isResolutionBased()
If true, you'll be called after all the non-resolution based visitors. NB: Temporary solution - will be rewritten to a different style altogether in a future release.


visitCompilationUnit

void visitCompilationUnit(JavacNode top,
                          com.sun.tools.javac.tree.JCTree.JCCompilationUnit unit)
Called at the very beginning and end.


endVisitCompilationUnit

void endVisitCompilationUnit(JavacNode top,
                             com.sun.tools.javac.tree.JCTree.JCCompilationUnit unit)

visitType

void visitType(JavacNode typeNode,
               com.sun.tools.javac.tree.JCTree.JCClassDecl type)
Called when visiting a type (a class, interface, annotation, enum, etcetera).


visitAnnotationOnType

void visitAnnotationOnType(com.sun.tools.javac.tree.JCTree.JCClassDecl type,
                           JavacNode annotationNode,
                           com.sun.tools.javac.tree.JCTree.JCAnnotation annotation)

endVisitType

void endVisitType(JavacNode typeNode,
                  com.sun.tools.javac.tree.JCTree.JCClassDecl type)

visitField

void visitField(JavacNode fieldNode,
                com.sun.tools.javac.tree.JCTree.JCVariableDecl field)
Called when visiting a field of a class.


visitAnnotationOnField

void visitAnnotationOnField(com.sun.tools.javac.tree.JCTree.JCVariableDecl field,
                            JavacNode annotationNode,
                            com.sun.tools.javac.tree.JCTree.JCAnnotation annotation)

endVisitField

void endVisitField(JavacNode fieldNode,
                   com.sun.tools.javac.tree.JCTree.JCVariableDecl field)

visitInitializer

void visitInitializer(JavacNode initializerNode,
                      com.sun.tools.javac.tree.JCTree.JCBlock initializer)
Called for static and instance initializers. You can tell the difference via the isStatic() method.


endVisitInitializer

void endVisitInitializer(JavacNode initializerNode,
                         com.sun.tools.javac.tree.JCTree.JCBlock initializer)

visitMethod

void visitMethod(JavacNode methodNode,
                 com.sun.tools.javac.tree.JCTree.JCMethodDecl method)
Called for both methods and constructors.


visitAnnotationOnMethod

void visitAnnotationOnMethod(com.sun.tools.javac.tree.JCTree.JCMethodDecl method,
                             JavacNode annotationNode,
                             com.sun.tools.javac.tree.JCTree.JCAnnotation annotation)

endVisitMethod

void endVisitMethod(JavacNode methodNode,
                    com.sun.tools.javac.tree.JCTree.JCMethodDecl method)

visitMethodArgument

void visitMethodArgument(JavacNode argumentNode,
                         com.sun.tools.javac.tree.JCTree.JCVariableDecl argument,
                         com.sun.tools.javac.tree.JCTree.JCMethodDecl method)
Visits a method argument.


visitAnnotationOnMethodArgument

void visitAnnotationOnMethodArgument(com.sun.tools.javac.tree.JCTree.JCVariableDecl argument,
                                     com.sun.tools.javac.tree.JCTree.JCMethodDecl method,
                                     JavacNode annotationNode,
                                     com.sun.tools.javac.tree.JCTree.JCAnnotation annotation)

endVisitMethodArgument

void endVisitMethodArgument(JavacNode argumentNode,
                            com.sun.tools.javac.tree.JCTree.JCVariableDecl argument,
                            com.sun.tools.javac.tree.JCTree.JCMethodDecl method)

visitLocal

void visitLocal(JavacNode localNode,
                com.sun.tools.javac.tree.JCTree.JCVariableDecl local)
Visits a local declaration - that is, something like 'int x = 10;' on the method level. Also called for method parameters.


visitAnnotationOnLocal

void visitAnnotationOnLocal(com.sun.tools.javac.tree.JCTree.JCVariableDecl local,
                            JavacNode annotationNode,
                            com.sun.tools.javac.tree.JCTree.JCAnnotation annotation)

endVisitLocal

void endVisitLocal(JavacNode localNode,
                   com.sun.tools.javac.tree.JCTree.JCVariableDecl local)

visitStatement

void visitStatement(JavacNode statementNode,
                    com.sun.tools.javac.tree.JCTree statement)
Visits a statement that isn't any of the other visit methods (e.g. JCClassDecl). The statement object is guaranteed to be either a JCStatement or a JCExpression.


endVisitStatement

void endVisitStatement(JavacNode statementNode,
                       com.sun.tools.javac.tree.JCTree statement)

Lombok - v0.10.8

Copyright © 2009-2011 The Project Lombok Authors, licensed under the MIT licence.