aboutsummaryrefslogtreecommitdiff
path: root/src/lombok/eclipse/handlers/HandlePrintAST.java
blob: 4438f4e42aaab6620ad23cc45237554e23ceaa3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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<PrintAST> {
	@Override public boolean handle(AnnotationValues<PrintAST> annotation, Annotation ast, Node annotationNode) {
		if ( !annotationNode.isCompleteParse() ) return false;
		annotationNode.up().traverse(new EclipseASTVisitor.EclipseASTPrinter());
		return true;
	}
}