From 0774cf929ca3746db650563b74bebeab11af19fa Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Thu, 19 Jan 2012 00:42:15 +0100 Subject: updated documentation to reflect ability of putting delegate on methods. --- website/features/Delegate.html | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'website') diff --git a/website/features/Delegate.html b/website/features/Delegate.html index 28cd0a6b..4872c2e9 100644 --- a/website/features/Delegate.html +++ b/website/features/Delegate.html @@ -15,20 +15,20 @@

Overview

- NEW IN Lombok 0.10: Any field can be annotated with @Delegate to let lombok generate delegate methods that forward the call - to this field. + NEW IN Lombok 0.10: Any field or no-argument method can be annotated with @Delegate to let lombok generate delegate methods + that forward the call to this field (or the result of invoking this method).

- Lombok delegates all public methods of the field's type, as well as those of its supertype except for all methods declared - in java.lang.Object. + Lombok delegates all public methods of the field's type (or method's return type), as well as those of its supertype except for all + methods declared in java.lang.Object.

You can pass any number of classes into the @Delegate annotation's types parameter. If you do that, then lombok will delegate all public methods in those types (and their supertypes, except - java.lang.Object) instead of looking at the field's type. + java.lang.Object) instead of looking at the field/method's type.

- All public non-Object methods that are part of the field's type (or, if you used types parameter, the methods of those types) are + All public non-Object methods that are part of the calculated type(s) are copied, whether or not you also wrote implementations for those methods. That would thus result in duplicate method errors. You can avoid these by using the @Delegate(excludes=SomeType.class) parameter to exclude all public methods in the excluded type(s), and their supertypes.

@@ -59,6 +59,8 @@

When passing classes to the annotation, these classes do not need to be supertypes of the field. See the example.

+

+ @Delegate cannot be used on static fields or methods.