Lombok - v0.9.3

lombok.eclipse
Class EclipseASTVisitor.Printer

java.lang.Object
  extended by lombok.eclipse.EclipseASTVisitor.Printer
All Implemented Interfaces:
EclipseASTVisitor
Enclosing interface:
EclipseASTVisitor

public static class EclipseASTVisitor.Printer
extends java.lang.Object
implements EclipseASTVisitor

Prints the structure of an AST.


Nested Class Summary
 
Nested classes/interfaces inherited from interface lombok.eclipse.EclipseASTVisitor
EclipseASTVisitor.Printer
 
Constructor Summary
EclipseASTVisitor.Printer(boolean printContent)
           
EclipseASTVisitor.Printer(boolean printContent, java.io.PrintStream out)
           
 
Method Summary
 void endVisitCompilationUnit(EclipseNode node, org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration unit)
           
 void endVisitField(EclipseNode node, org.eclipse.jdt.internal.compiler.ast.FieldDeclaration field)
           
 void endVisitInitializer(EclipseNode node, org.eclipse.jdt.internal.compiler.ast.Initializer initializer)
           
 void endVisitLocal(EclipseNode node, org.eclipse.jdt.internal.compiler.ast.LocalDeclaration local)
           
 void endVisitMethod(EclipseNode node, org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method)
           
 void endVisitMethodArgument(EclipseNode node, org.eclipse.jdt.internal.compiler.ast.Argument arg, org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method)
           
 void endVisitStatement(EclipseNode node, org.eclipse.jdt.internal.compiler.ast.Statement statement)
           
 void endVisitType(EclipseNode node, org.eclipse.jdt.internal.compiler.ast.TypeDeclaration type)
           
 void visitAnnotationOnField(org.eclipse.jdt.internal.compiler.ast.FieldDeclaration field, EclipseNode node, org.eclipse.jdt.internal.compiler.ast.Annotation annotation)
           
 void visitAnnotationOnLocal(org.eclipse.jdt.internal.compiler.ast.LocalDeclaration local, EclipseNode node, org.eclipse.jdt.internal.compiler.ast.Annotation annotation)
           
 void visitAnnotationOnMethod(org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method, EclipseNode node, 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 node, org.eclipse.jdt.internal.compiler.ast.Annotation annotation)
           
 void visitAnnotationOnType(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration type, EclipseNode node, org.eclipse.jdt.internal.compiler.ast.Annotation annotation)
           
 void visitCompilationUnit(EclipseNode node, org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration unit)
          Called at the very beginning and end.
 void visitField(EclipseNode node, org.eclipse.jdt.internal.compiler.ast.FieldDeclaration field)
          Called when visiting a field of a class.
 void visitInitializer(EclipseNode node, org.eclipse.jdt.internal.compiler.ast.Initializer initializer)
          Called for static and instance initializers.
 void visitLocal(EclipseNode node, 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 node, 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 node, org.eclipse.jdt.internal.compiler.ast.Argument arg, org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method)
          Visits a method argument
 void visitStatement(EclipseNode node, 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 node, org.eclipse.jdt.internal.compiler.ast.TypeDeclaration type)
          Called when visiting a type (a class, interface, annotation, enum, etcetera).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EclipseASTVisitor.Printer

public EclipseASTVisitor.Printer(boolean printContent)
Parameters:
printContent - if true, bodies are printed directly, as java code, instead of a tree listing of every AST node inside it.

EclipseASTVisitor.Printer

public EclipseASTVisitor.Printer(boolean printContent,
                                 java.io.PrintStream out)
Parameters:
printContent - if true, bodies are printed directly, as java code, instead of a tree listing of every AST node inside it.
out - write output to this stream. You must close it yourself. flush() is called after every line.
See Also:
PrintStream.flush()
Method Detail

visitCompilationUnit

public void visitCompilationUnit(EclipseNode node,
                                 org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration unit)
Description copied from interface: EclipseASTVisitor
Called at the very beginning and end.

Specified by:
visitCompilationUnit in interface EclipseASTVisitor

endVisitCompilationUnit

public void endVisitCompilationUnit(EclipseNode node,
                                    org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration unit)
Specified by:
endVisitCompilationUnit in interface EclipseASTVisitor

visitType

public void visitType(EclipseNode node,
                      org.eclipse.jdt.internal.compiler.ast.TypeDeclaration type)
Description copied from interface: EclipseASTVisitor
Called when visiting a type (a class, interface, annotation, enum, etcetera).

Specified by:
visitType in interface EclipseASTVisitor

visitAnnotationOnType

public void visitAnnotationOnType(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration type,
                                  EclipseNode node,
                                  org.eclipse.jdt.internal.compiler.ast.Annotation annotation)
Specified by:
visitAnnotationOnType in interface EclipseASTVisitor

endVisitType

public void endVisitType(EclipseNode node,
                         org.eclipse.jdt.internal.compiler.ast.TypeDeclaration type)
Specified by:
endVisitType in interface EclipseASTVisitor

visitInitializer

public void visitInitializer(EclipseNode node,
                             org.eclipse.jdt.internal.compiler.ast.Initializer initializer)
Description copied from interface: EclipseASTVisitor
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.

Specified by:
visitInitializer in interface EclipseASTVisitor

endVisitInitializer

public void endVisitInitializer(EclipseNode node,
                                org.eclipse.jdt.internal.compiler.ast.Initializer initializer)
Specified by:
endVisitInitializer in interface EclipseASTVisitor

visitField

public void visitField(EclipseNode node,
                       org.eclipse.jdt.internal.compiler.ast.FieldDeclaration field)
Description copied from interface: EclipseASTVisitor
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.

Specified by:
visitField in interface EclipseASTVisitor

visitAnnotationOnField

public void visitAnnotationOnField(org.eclipse.jdt.internal.compiler.ast.FieldDeclaration field,
                                   EclipseNode node,
                                   org.eclipse.jdt.internal.compiler.ast.Annotation annotation)
Specified by:
visitAnnotationOnField in interface EclipseASTVisitor

endVisitField

public void endVisitField(EclipseNode node,
                          org.eclipse.jdt.internal.compiler.ast.FieldDeclaration field)
Specified by:
endVisitField in interface EclipseASTVisitor

visitMethod

public void visitMethod(EclipseNode node,
                        org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method)
Description copied from interface: EclipseASTVisitor
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.

Specified by:
visitMethod in interface EclipseASTVisitor

visitAnnotationOnMethod

public void visitAnnotationOnMethod(org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method,
                                    EclipseNode node,
                                    org.eclipse.jdt.internal.compiler.ast.Annotation annotation)
Specified by:
visitAnnotationOnMethod in interface EclipseASTVisitor

endVisitMethod

public void endVisitMethod(EclipseNode node,
                           org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method)
Specified by:
endVisitMethod in interface EclipseASTVisitor

visitMethodArgument

public void visitMethodArgument(EclipseNode node,
                                org.eclipse.jdt.internal.compiler.ast.Argument arg,
                                org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method)
Description copied from interface: EclipseASTVisitor
Visits a method argument

Specified by:
visitMethodArgument in interface EclipseASTVisitor

visitAnnotationOnMethodArgument

public void visitAnnotationOnMethodArgument(org.eclipse.jdt.internal.compiler.ast.Argument arg,
                                            org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method,
                                            EclipseNode node,
                                            org.eclipse.jdt.internal.compiler.ast.Annotation annotation)
Specified by:
visitAnnotationOnMethodArgument in interface EclipseASTVisitor

endVisitMethodArgument

public void endVisitMethodArgument(EclipseNode node,
                                   org.eclipse.jdt.internal.compiler.ast.Argument arg,
                                   org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method)
Specified by:
endVisitMethodArgument in interface EclipseASTVisitor

visitLocal

public void visitLocal(EclipseNode node,
                       org.eclipse.jdt.internal.compiler.ast.LocalDeclaration local)
Description copied from interface: EclipseASTVisitor
Visits a local declaration - that is, something like 'int x = 10;' on the method level.

Specified by:
visitLocal in interface EclipseASTVisitor

visitAnnotationOnLocal

public void visitAnnotationOnLocal(org.eclipse.jdt.internal.compiler.ast.LocalDeclaration local,
                                   EclipseNode node,
                                   org.eclipse.jdt.internal.compiler.ast.Annotation annotation)
Specified by:
visitAnnotationOnLocal in interface EclipseASTVisitor

endVisitLocal

public void endVisitLocal(EclipseNode node,
                          org.eclipse.jdt.internal.compiler.ast.LocalDeclaration local)
Specified by:
endVisitLocal in interface EclipseASTVisitor

visitStatement

public void visitStatement(EclipseNode node,
                           org.eclipse.jdt.internal.compiler.ast.Statement statement)
Description copied from interface: EclipseASTVisitor
Visits a statement that isn't any of the other visit methods (e.g. TypeDeclaration).

Specified by:
visitStatement in interface EclipseASTVisitor

endVisitStatement

public void endVisitStatement(EclipseNode node,
                              org.eclipse.jdt.internal.compiler.ast.Statement statement)
Specified by:
endVisitStatement in interface EclipseASTVisitor

Lombok - v0.9.3

Copyright © 2009 Reinier Zwitserloot and Roel Spilker, licensed under the MIT licence.