From 8aae52a9923c041486484d30b9b35ee9b6f2a8ea Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Wed, 17 Jun 2009 20:54:54 +0200 Subject: A useful annotation that prints the AST of any annotated element via the XASTPrinters in each ASTVisitor interface. --- src/lombok/eclipse/handlers/HandlePrintAST.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/lombok/eclipse/handlers/HandlePrintAST.java (limited to 'src/lombok/eclipse') diff --git a/src/lombok/eclipse/handlers/HandlePrintAST.java b/src/lombok/eclipse/handlers/HandlePrintAST.java new file mode 100644 index 00000000..2e379ce3 --- /dev/null +++ b/src/lombok/eclipse/handlers/HandlePrintAST.java @@ -0,0 +1,17 @@ +package lombok.eclipse.handlers; + +import org.eclipse.jdt.internal.compiler.ast.Annotation; +import org.mangosdk.spi.ProviderFor; + +import lombok.core.AnnotationValues; +import lombok.core.PrintAST; +import lombok.eclipse.EclipseASTVisitor; +import lombok.eclipse.EclipseAnnotationHandler; +import lombok.eclipse.EclipseAST.Node; + +@ProviderFor(EclipseAnnotationHandler.class) +public class HandlePrintAST implements EclipseAnnotationHandler { + @Override public void handle(AnnotationValues annotation, Annotation ast, Node annotationNode) { + annotationNode.up().traverse(new EclipseASTVisitor.EclipseASTPrinter()); + } +} -- cgit