aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/eclipse/EclipseASTVisitor.java
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2011-06-02 06:37:01 +0200
committerReinier Zwitserloot <reinier@zwitserloot.com>2011-06-02 06:43:48 +0200
commit964b82124dd92e91652925a450ab9208e41df601 (patch)
treeef92d5c72f86fc70ceb4e4693b188bedc5e9ed40 /src/core/lombok/eclipse/EclipseASTVisitor.java
parentcd6eee36cfc10e2dcb1dc12cbaa27db7c0b384a5 (diff)
downloadlombok-964b82124dd92e91652925a450ab9208e41df601.tar.gz
lombok-964b82124dd92e91652925a450ab9208e41df601.tar.bz2
lombok-964b82124dd92e91652925a450ab9208e41df601.zip
Eclipse handlers can now opt out of being run in diet-parse mode. Fixes Synchronized and SneakyThrows
Diffstat (limited to 'src/core/lombok/eclipse/EclipseASTVisitor.java')
-rw-r--r--src/core/lombok/eclipse/EclipseASTVisitor.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/core/lombok/eclipse/EclipseASTVisitor.java b/src/core/lombok/eclipse/EclipseASTVisitor.java
index 0c0e2d96..7f9faf43 100644
--- a/src/core/lombok/eclipse/EclipseASTVisitor.java
+++ b/src/core/lombok/eclipse/EclipseASTVisitor.java
@@ -1,5 +1,5 @@
/*
- * Copyright © 2009 Reinier Zwitserloot and Roel Spilker.
+ * Copyright © 2009-2011 Reinier Zwitserloot and Roel Spilker.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -43,6 +43,13 @@ import org.eclipse.jdt.internal.compiler.ast.TypeReference;
*/
public interface EclipseASTVisitor {
/**
+ * Return true if this handler should not be run in the diet parse phase.
+ * 'diet parse' is where method bodies aren't filled in yet. If you have a method-level annotation that modifies the contents of that method,
+ * return {@code true} here. Otherwise, return {@code false} here.
+ */
+ boolean deferUntilPostDiet();
+
+ /**
* Called at the very beginning and end.
*/
void visitCompilationUnit(EclipseNode top, CompilationUnitDeclaration unit);
@@ -112,6 +119,10 @@ public interface EclipseASTVisitor {
private int indent = 0;
private boolean printClassNames = false;
+ public boolean deferUntilPostDiet() {
+ return false;
+ }
+
/**
* @param printContent if true, bodies are printed directly, as java code,
* instead of a tree listing of every AST node inside it.