From bc44e76b7d45da2301a1bb7d28d4e7e8fec4b94b Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Sat, 11 Jul 2009 11:11:32 +0200 Subject: Made 'printContent=true' work for types as well as method bodies/initializers. --- src/lombok/eclipse/EclipseASTVisitor.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/lombok/eclipse') diff --git a/src/lombok/eclipse/EclipseASTVisitor.java b/src/lombok/eclipse/EclipseASTVisitor.java index 84a27e48..6cc4130f 100644 --- a/src/lombok/eclipse/EclipseASTVisitor.java +++ b/src/lombok/eclipse/EclipseASTVisitor.java @@ -114,7 +114,7 @@ public interface EclipseASTVisitor { private int indent = 0; /** - * @param printContent if true, method and initializer bodies are printed directly, as java code, + * @param printContent if true, bodies are printed directly, as java code, * instead of a tree listing of every AST node inside it. */ public Printer(boolean printContent) { @@ -122,7 +122,7 @@ public interface EclipseASTVisitor { } /** - * @param printContent if true, method and initializer bodies are printed directly, as java code, + * @param printContent if true, bodies are printed directly, as java code, * instead of a tree listing of every AST node inside it. * @param out write output to this stream. You must close it yourself. flush() is called after every line. * @@ -177,6 +177,10 @@ public interface EclipseASTVisitor { public void visitType(Node node, TypeDeclaration type) { print("", str(type.name)); indent++; + if ( printContent ) { + print("%s", type); + disablePrinting++; + } } public void visitAnnotationOnType(TypeDeclaration type, Node node, Annotation annotation) { @@ -184,6 +188,7 @@ public interface EclipseASTVisitor { } public void endVisitType(Node node, TypeDeclaration type) { + if ( printContent ) disablePrinting--; indent--; print("", str(type.name)); } -- cgit