Lombok - v0.10.8

lombok.javac
Class JavacASTVisitor.Printer

java.lang.Object
  extended by lombok.javac.JavacASTVisitor.Printer
All Implemented Interfaces:
JavacASTVisitor
Enclosing interface:
JavacASTVisitor

public static class JavacASTVisitor.Printer
extends Object
implements JavacASTVisitor

Prints the structure of an AST.


Nested Class Summary
 
Nested classes/interfaces inherited from interface lombok.javac.JavacASTVisitor
JavacASTVisitor.Printer
 
Constructor Summary
JavacASTVisitor.Printer(boolean printContent)
           
JavacASTVisitor.Printer(boolean printContent, PrintStream out)
           
 
Method Summary
 void endVisitCompilationUnit(JavacNode node, com.sun.tools.javac.tree.JCTree.JCCompilationUnit unit)
           
 void endVisitField(JavacNode node, com.sun.tools.javac.tree.JCTree.JCVariableDecl field)
           
 void endVisitInitializer(JavacNode node, com.sun.tools.javac.tree.JCTree.JCBlock initializer)
           
 void endVisitLocal(JavacNode node, com.sun.tools.javac.tree.JCTree.JCVariableDecl local)
           
 void endVisitMethod(JavacNode node, com.sun.tools.javac.tree.JCTree.JCMethodDecl method)
           
 void endVisitMethodArgument(JavacNode node, com.sun.tools.javac.tree.JCTree.JCVariableDecl arg, com.sun.tools.javac.tree.JCTree.JCMethodDecl method)
           
 void endVisitStatement(JavacNode node, com.sun.tools.javac.tree.JCTree statement)
           
 void endVisitType(JavacNode node, 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 node, com.sun.tools.javac.tree.JCTree.JCAnnotation annotation)
           
 void visitAnnotationOnLocal(com.sun.tools.javac.tree.JCTree.JCVariableDecl local, JavacNode node, com.sun.tools.javac.tree.JCTree.JCAnnotation annotation)
           
 void visitAnnotationOnMethod(com.sun.tools.javac.tree.JCTree.JCMethodDecl method, JavacNode node, com.sun.tools.javac.tree.JCTree.JCAnnotation annotation)
           
 void visitAnnotationOnMethodArgument(com.sun.tools.javac.tree.JCTree.JCVariableDecl arg, com.sun.tools.javac.tree.JCTree.JCMethodDecl method, JavacNode nodeAnnotation, com.sun.tools.javac.tree.JCTree.JCAnnotation annotation)
           
 void visitAnnotationOnType(com.sun.tools.javac.tree.JCTree.JCClassDecl type, JavacNode node, com.sun.tools.javac.tree.JCTree.JCAnnotation annotation)
           
 void visitCompilationUnit(JavacNode LombokNode, com.sun.tools.javac.tree.JCTree.JCCompilationUnit unit)
          Called at the very beginning and end.
 void visitField(JavacNode node, com.sun.tools.javac.tree.JCTree.JCVariableDecl field)
          Called when visiting a field of a class.
 void visitInitializer(JavacNode node, com.sun.tools.javac.tree.JCTree.JCBlock initializer)
          Called for static and instance initializers.
 void visitLocal(JavacNode node, 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 node, com.sun.tools.javac.tree.JCTree.JCMethodDecl method)
          Called for both methods and constructors.
 void visitMethodArgument(JavacNode node, com.sun.tools.javac.tree.JCTree.JCVariableDecl arg, com.sun.tools.javac.tree.JCTree.JCMethodDecl method)
          Visits a method argument.
 void visitStatement(JavacNode node, com.sun.tools.javac.tree.JCTree statement)
          Visits a statement that isn't any of the other visit methods (e.g.
 void visitType(JavacNode node, com.sun.tools.javac.tree.JCTree.JCClassDecl 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

JavacASTVisitor.Printer

public JavacASTVisitor.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.

JavacASTVisitor.Printer

public JavacASTVisitor.Printer(boolean printContent,
                               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

isResolutionBased

public boolean isResolutionBased()
Description copied from interface: JavacASTVisitor
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.

Specified by:
isResolutionBased in interface JavacASTVisitor

visitCompilationUnit

public void visitCompilationUnit(JavacNode LombokNode,
                                 com.sun.tools.javac.tree.JCTree.JCCompilationUnit unit)
Description copied from interface: JavacASTVisitor
Called at the very beginning and end.

Specified by:
visitCompilationUnit in interface JavacASTVisitor

endVisitCompilationUnit

public void endVisitCompilationUnit(JavacNode node,
                                    com.sun.tools.javac.tree.JCTree.JCCompilationUnit unit)
Specified by:
endVisitCompilationUnit in interface JavacASTVisitor

visitType

public void visitType(JavacNode node,
                      com.sun.tools.javac.tree.JCTree.JCClassDecl type)
Description copied from interface: JavacASTVisitor
Called when visiting a type (a class, interface, annotation, enum, etcetera).

Specified by:
visitType in interface JavacASTVisitor

visitAnnotationOnType

public void visitAnnotationOnType(com.sun.tools.javac.tree.JCTree.JCClassDecl type,
                                  JavacNode node,
                                  com.sun.tools.javac.tree.JCTree.JCAnnotation annotation)
Specified by:
visitAnnotationOnType in interface JavacASTVisitor

endVisitType

public void endVisitType(JavacNode node,
                         com.sun.tools.javac.tree.JCTree.JCClassDecl type)
Specified by:
endVisitType in interface JavacASTVisitor

visitInitializer

public void visitInitializer(JavacNode node,
                             com.sun.tools.javac.tree.JCTree.JCBlock initializer)
Description copied from interface: JavacASTVisitor
Called for static and instance initializers. You can tell the difference via the isStatic() method.

Specified by:
visitInitializer in interface JavacASTVisitor

endVisitInitializer

public void endVisitInitializer(JavacNode node,
                                com.sun.tools.javac.tree.JCTree.JCBlock initializer)
Specified by:
endVisitInitializer in interface JavacASTVisitor

visitField

public void visitField(JavacNode node,
                       com.sun.tools.javac.tree.JCTree.JCVariableDecl field)
Description copied from interface: JavacASTVisitor
Called when visiting a field of a class.

Specified by:
visitField in interface JavacASTVisitor

visitAnnotationOnField

public void visitAnnotationOnField(com.sun.tools.javac.tree.JCTree.JCVariableDecl field,
                                   JavacNode node,
                                   com.sun.tools.javac.tree.JCTree.JCAnnotation annotation)
Specified by:
visitAnnotationOnField in interface JavacASTVisitor

endVisitField

public void endVisitField(JavacNode node,
                          com.sun.tools.javac.tree.JCTree.JCVariableDecl field)
Specified by:
endVisitField in interface JavacASTVisitor

visitMethod

public void visitMethod(JavacNode node,
                        com.sun.tools.javac.tree.JCTree.JCMethodDecl method)
Description copied from interface: JavacASTVisitor
Called for both methods and constructors.

Specified by:
visitMethod in interface JavacASTVisitor

visitAnnotationOnMethod

public void visitAnnotationOnMethod(com.sun.tools.javac.tree.JCTree.JCMethodDecl method,
                                    JavacNode node,
                                    com.sun.tools.javac.tree.JCTree.JCAnnotation annotation)
Specified by:
visitAnnotationOnMethod in interface JavacASTVisitor

endVisitMethod

public void endVisitMethod(JavacNode node,
                           com.sun.tools.javac.tree.JCTree.JCMethodDecl method)
Specified by:
endVisitMethod in interface JavacASTVisitor

visitMethodArgument

public void visitMethodArgument(JavacNode node,
                                com.sun.tools.javac.tree.JCTree.JCVariableDecl arg,
                                com.sun.tools.javac.tree.JCTree.JCMethodDecl method)
Description copied from interface: JavacASTVisitor
Visits a method argument.

Specified by:
visitMethodArgument in interface JavacASTVisitor

visitAnnotationOnMethodArgument

public void visitAnnotationOnMethodArgument(com.sun.tools.javac.tree.JCTree.JCVariableDecl arg,
                                            com.sun.tools.javac.tree.JCTree.JCMethodDecl method,
                                            JavacNode nodeAnnotation,
                                            com.sun.tools.javac.tree.JCTree.JCAnnotation annotation)
Specified by:
visitAnnotationOnMethodArgument in interface JavacASTVisitor

endVisitMethodArgument

public void endVisitMethodArgument(JavacNode node,
                                   com.sun.tools.javac.tree.JCTree.JCVariableDecl arg,
                                   com.sun.tools.javac.tree.JCTree.JCMethodDecl method)
Specified by:
endVisitMethodArgument in interface JavacASTVisitor

visitLocal

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

Specified by:
visitLocal in interface JavacASTVisitor

visitAnnotationOnLocal

public void visitAnnotationOnLocal(com.sun.tools.javac.tree.JCTree.JCVariableDecl local,
                                   JavacNode node,
                                   com.sun.tools.javac.tree.JCTree.JCAnnotation annotation)
Specified by:
visitAnnotationOnLocal in interface JavacASTVisitor

endVisitLocal

public void endVisitLocal(JavacNode node,
                          com.sun.tools.javac.tree.JCTree.JCVariableDecl local)
Specified by:
endVisitLocal in interface JavacASTVisitor

visitStatement

public void visitStatement(JavacNode node,
                           com.sun.tools.javac.tree.JCTree statement)
Description copied from interface: JavacASTVisitor
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.

Specified by:
visitStatement in interface JavacASTVisitor

endVisitStatement

public void endVisitStatement(JavacNode node,
                              com.sun.tools.javac.tree.JCTree statement)
Specified by:
endVisitStatement in interface JavacASTVisitor

Lombok - v0.10.8

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