Lombok - v0.10.8

lombok.eclipse
Interface EclipseASTVisitor

All Known Implementing Classes:
EclipseASTAdapter, EclipseASTVisitor.Printer, HandleVal

public interface EclipseASTVisitor

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


Nested Class Summary
static class EclipseASTVisitor.Printer
          Prints the structure of an AST.
 
Method Summary
 boolean deferUntilPostDiet()
          Return true if this handler should not be run in the diet parse phase.
 void endVisitCompilationUnit(EclipseNode top, org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration unit)
           
 void endVisitField(EclipseNode fieldNode, org.eclipse.jdt.internal.compiler.ast.FieldDeclaration field)
           
 void endVisitInitializer(EclipseNode initializerNode, org.eclipse.jdt.internal.compiler.ast.Initializer initializer)
           
 void endVisitLocal(EclipseNode localNode, org.eclipse.jdt.internal.compiler.ast.LocalDeclaration local)
           
 void endVisitMethod(EclipseNode methodNode, org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method)
           
 void endVisitMethodArgument(EclipseNode argNode, org.eclipse.jdt.internal.compiler.ast.Argument arg, org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method)
           
 void endVisitStatement(EclipseNode statementNode, org.eclipse.jdt.internal.compiler.ast.Statement statement)
           
 void endVisitType(EclipseNode typeNode, org.eclipse.jdt.internal.compiler.ast.TypeDeclaration type)
           
 void visitAnnotationOnField(org.eclipse.jdt.internal.compiler.ast.FieldDeclaration field, EclipseNode annotationNode, org.eclipse.jdt.internal.compiler.ast.Annotation annotation)
           
 void visitAnnotationOnLocal(org.eclipse.jdt.internal.compiler.ast.LocalDeclaration local, EclipseNode annotationNode, org.eclipse.jdt.internal.compiler.ast.Annotation annotation)
           
 void visitAnnotationOnMethod(org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method, EclipseNode annotationNode, org.eclipse.jdt.internal.compiler.ast.Annotation annotation)
           
 void visitAnnotationOnMethodArgument(org.eclipse.jdt.internal.compiler.ast.Argument arg, org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method, EclipseNode annotationNode, org.eclipse.jdt.internal.compiler.ast.Annotation annotation)
           
 void visitAnnotationOnType(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration type, EclipseNode annotationNode, org.eclipse.jdt.internal.compiler.ast.Annotation annotation)
           
 void visitCompilationUnit(EclipseNode top, org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration unit)
          Called at the very beginning and end.
 void visitField(EclipseNode fieldNode, org.eclipse.jdt.internal.compiler.ast.FieldDeclaration field)
          Called when visiting a field of a class.
 void visitInitializer(EclipseNode initializerNode, org.eclipse.jdt.internal.compiler.ast.Initializer initializer)
          Called for static and instance initializers.
 void visitLocal(EclipseNode localNode, org.eclipse.jdt.internal.compiler.ast.LocalDeclaration local)
          Visits a local declaration - that is, something like 'int x = 10;' on the method level.
 void visitMethod(EclipseNode methodNode, org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method)
          Called for both methods (MethodDeclaration) and constructors (ConstructorDeclaration), but not for Clinit objects, which are a vestigial Eclipse thing that never contain anything.
 void visitMethodArgument(EclipseNode argNode, org.eclipse.jdt.internal.compiler.ast.Argument arg, org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method)
          Visits a method argument
 void visitStatement(EclipseNode statementNode, org.eclipse.jdt.internal.compiler.ast.Statement statement)
          Visits a statement that isn't any of the other visit methods (e.g.
 void visitType(EclipseNode typeNode, org.eclipse.jdt.internal.compiler.ast.TypeDeclaration type)
          Called when visiting a type (a class, interface, annotation, enum, etcetera).
 

Method Detail

deferUntilPostDiet

boolean deferUntilPostDiet()
Return true if this handler should not be run in the diet parse phase. 'diet parse' is where method bodies aren't filled in yet. If you have a method-level annotation that modifies the contents of that method, return true here. Otherwise, return false here.


visitCompilationUnit

void visitCompilationUnit(EclipseNode top,
                          org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration unit)
Called at the very beginning and end.


endVisitCompilationUnit

void endVisitCompilationUnit(EclipseNode top,
                             org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration unit)

visitType

void visitType(EclipseNode typeNode,
               org.eclipse.jdt.internal.compiler.ast.TypeDeclaration type)
Called when visiting a type (a class, interface, annotation, enum, etcetera).


visitAnnotationOnType

void visitAnnotationOnType(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration type,
                           EclipseNode annotationNode,
                           org.eclipse.jdt.internal.compiler.ast.Annotation annotation)

endVisitType

void endVisitType(EclipseNode typeNode,
                  org.eclipse.jdt.internal.compiler.ast.TypeDeclaration type)

visitField

void visitField(EclipseNode fieldNode,
                org.eclipse.jdt.internal.compiler.ast.FieldDeclaration field)
Called when visiting a field of a class. Even though in Eclipse initializers (both instance and static) are represented as Initializer objects, which are a subclass of FieldDeclaration, those do NOT result in a call to this method. They result in a call to the visitInitializer method.


visitAnnotationOnField

void visitAnnotationOnField(org.eclipse.jdt.internal.compiler.ast.FieldDeclaration field,
                            EclipseNode annotationNode,
                            org.eclipse.jdt.internal.compiler.ast.Annotation annotation)

endVisitField

void endVisitField(EclipseNode fieldNode,
                   org.eclipse.jdt.internal.compiler.ast.FieldDeclaration field)

visitInitializer

void visitInitializer(EclipseNode initializerNode,
                      org.eclipse.jdt.internal.compiler.ast.Initializer initializer)
Called for static and instance initializers. You can tell the difference via the modifier flag on the ASTNode (8 for static, 0 for not static). The content is in the 'block', not in the 'initialization', which would always be null for an initializer instance.


endVisitInitializer

void endVisitInitializer(EclipseNode initializerNode,
                         org.eclipse.jdt.internal.compiler.ast.Initializer initializer)

visitMethod

void visitMethod(EclipseNode methodNode,
                 org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method)
Called for both methods (MethodDeclaration) and constructors (ConstructorDeclaration), but not for Clinit objects, which are a vestigial Eclipse thing that never contain anything. Static initializers show up as 'Initializer', in the visitInitializer method, with modifier bit STATIC set.


visitAnnotationOnMethod

void visitAnnotationOnMethod(org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method,
                             EclipseNode annotationNode,
                             org.eclipse.jdt.internal.compiler.ast.Annotation annotation)

endVisitMethod

void endVisitMethod(EclipseNode methodNode,
                    org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method)

visitMethodArgument

void visitMethodArgument(EclipseNode argNode,
                         org.eclipse.jdt.internal.compiler.ast.Argument arg,
                         org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method)
Visits a method argument


visitAnnotationOnMethodArgument

void visitAnnotationOnMethodArgument(org.eclipse.jdt.internal.compiler.ast.Argument arg,
                                     org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method,
                                     EclipseNode annotationNode,
                                     org.eclipse.jdt.internal.compiler.ast.Annotation annotation)

endVisitMethodArgument

void endVisitMethodArgument(EclipseNode argNode,
                            org.eclipse.jdt.internal.compiler.ast.Argument arg,
                            org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method)

visitLocal

void visitLocal(EclipseNode localNode,
                org.eclipse.jdt.internal.compiler.ast.LocalDeclaration local)
Visits a local declaration - that is, something like 'int x = 10;' on the method level.


visitAnnotationOnLocal

void visitAnnotationOnLocal(org.eclipse.jdt.internal.compiler.ast.LocalDeclaration local,
                            EclipseNode annotationNode,
                            org.eclipse.jdt.internal.compiler.ast.Annotation annotation)

endVisitLocal

void endVisitLocal(EclipseNode localNode,
                   org.eclipse.jdt.internal.compiler.ast.LocalDeclaration local)

visitStatement

void visitStatement(EclipseNode statementNode,
                    org.eclipse.jdt.internal.compiler.ast.Statement statement)
Visits a statement that isn't any of the other visit methods (e.g. TypeDeclaration).


endVisitStatement

void endVisitStatement(EclipseNode statementNode,
                       org.eclipse.jdt.internal.compiler.ast.Statement statement)

Lombok - v0.10.8

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