From 6d425594176e8493ecec4d5e958a2dcbd611eeb1 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Wed, 24 Jun 2009 01:23:10 +0200 Subject: Work on HandleData, as well as generalizing features in the the PKG class and updating HandleGetter/Setter to call into it. --- src/lombok/javac/HandlerLibrary.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/lombok/javac/HandlerLibrary.java') diff --git a/src/lombok/javac/HandlerLibrary.java b/src/lombok/javac/HandlerLibrary.java index f9404668..ab5388d3 100644 --- a/src/lombok/javac/HandlerLibrary.java +++ b/src/lombok/javac/HandlerLibrary.java @@ -13,6 +13,7 @@ import javax.annotation.processing.Messager; import javax.lang.model.element.TypeElement; import javax.tools.Diagnostic; +import lombok.core.PrintAST; import lombok.core.SpiLoadUtil; import lombok.core.TypeLibrary; import lombok.core.TypeResolver; @@ -27,6 +28,7 @@ public class HandlerLibrary { private final Map> annotationHandlers = new HashMap>(); private final Collection visitorHandlers = new ArrayList(); private final Messager messager; + private boolean skipPrintAST = true; public HandlerLibrary(Messager messager) { this.messager = messager; @@ -111,6 +113,8 @@ public class HandlerLibrary { String rawType = annotation.annotationType.toString(); boolean handled = false; for ( String fqn : resolver.findTypeMatches(node, rawType) ) { + boolean isPrintAST = fqn.equals(PrintAST.class.getName()); + if ( isPrintAST == skipPrintAST ) continue; AnnotationHandlerContainer container = annotationHandlers.get(fqn); if ( container == null ) continue; @@ -137,4 +141,12 @@ public class HandlerLibrary { public boolean hasHandlerFor(TypeElement annotationType) { return annotationHandlers.containsKey(annotationType.getQualifiedName().toString()); } + + public void skipPrintAST() { + skipPrintAST = true; + } + + public void skipAllButPrintAST() { + skipPrintAST = false; + } } -- cgit