aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2011-05-03 02:54:08 +0200
committerReinier Zwitserloot <reinier@zwitserloot.com>2011-05-03 02:54:41 +0200
commit8c61bb0990a861ef481e2b9034b4c36df09e1061 (patch)
treef9a2f99d88e4da1e9c7832eeb505a794d43970f7 /src/core/lombok
parentb93a58298556aedaeef9e3d5fa4e53bc9b0ebe59 (diff)
downloadlombok-8c61bb0990a861ef481e2b9034b4c36df09e1061.tar.gz
lombok-8c61bb0990a861ef481e2b9034b4c36df09e1061.tar.bz2
lombok-8c61bb0990a861ef481e2b9034b4c36df09e1061.zip
Changed how @Delegate works in ecj - methods already present do NOT
preclude them from being generated, which means you get duplicate method errors. excludes=Types has been added to counteract this. Once we figure out how to resolve method sigs out of order we can go back to the original plan.
Diffstat (limited to 'src/core/lombok')
-rw-r--r--src/core/lombok/Delegate.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/core/lombok/Delegate.java b/src/core/lombok/Delegate.java
index 4308f6f9..c7a44c39 100644
--- a/src/core/lombok/Delegate.java
+++ b/src/core/lombok/Delegate.java
@@ -37,7 +37,8 @@ import java.lang.annotation.Target;
* will generate for example an {@code boolean add(String)} method, which contains: {@code return foo.add(arg);}, as well as all other methods in {@code List}.
*
* All public instance methods of the field's type, as well as all public instance methods of all the field's type's superfields are delegated, except for all methods
- * that exist in {@link java.lang.Object}, and except for methods that are already present in the class.
+ * that exist in {@link Object}, the {@code canEqual(Object)} method, and any methods that appear in types
+ * that are listed in the {@code excludes} property.
*/
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.SOURCE)
@@ -47,6 +48,15 @@ public @interface Delegate {
* type arguments can only be done as a field type. A solution for this is to create a private inner interface/class with the appropriate types extended, and possibly
* with all methods you'd like to delegate listed, and then supply that class here. The field does not actually have to implement the type you're delegating; the
* type listed here is used only to determine which delegate methods to generate.
+ *
+ * NB: All methods in {@code Object}, as well as {@code canEqual(Object other)} will never be delegated.
*/
- Class<?>[] value() default {};
+ Class<?>[] types() default {};
+
+ /**
+ * Each method in any of the types listed here (include supertypes) will <em>not</em> be delegated.
+ *
+ * NB: All methods in {@code Object}, as well as {@code canEqual(Object other)} will never be delegated.
+ */
+ Class<?>[] excludes() default {};
}