aboutsummaryrefslogtreecommitdiff
path: root/website/features/Delegate.html
diff options
context:
space:
mode:
authorRoel Spilker <r.spilker@gmail.com>2012-01-30 19:48:12 +0100
committerRoel Spilker <r.spilker@gmail.com>2012-01-30 19:48:12 +0100
commit55384884d380fba1a5fe024e1d82329d71c36f02 (patch)
treea19f69b9a4da56b58abb96e0a79d852eeb659bb0 /website/features/Delegate.html
parent98875218ea3f6ba68f7f83d3e0458c9901db00f3 (diff)
parentfc7ca61aeb3ee06c426573b5059e97532b601172 (diff)
downloadlombok-55384884d380fba1a5fe024e1d82329d71c36f02.tar.gz
lombok-55384884d380fba1a5fe024e1d82329d71c36f02.tar.bz2
lombok-55384884d380fba1a5fe024e1d82329d71c36f02.zip
Merge branch 'master' of github.com:rzwitserloot/lombok
Diffstat (limited to 'website/features/Delegate.html')
-rw-r--r--website/features/Delegate.html14
1 files changed, 8 insertions, 6 deletions
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 @@
<div class="overview">
<h3>Overview</h3>
<p>
- <em> NEW IN Lombok 0.10: </em> Any field can be annotated with <code>@Delegate</code> to let lombok generate delegate methods that forward the call
- to this field.
+ <em> NEW IN Lombok 0.10: </em> Any field or no-argument method can be annotated with <code>@Delegate</code> to let lombok generate delegate methods
+ that forward the call to this field (or the result of invoking this method).
</p>
<p>
- Lombok delegates all <code>public</code> methods of the field's type, as well as those of its supertype except for all methods declared
- in <code>java.lang.Object</code>.
+ Lombok delegates all <code>public</code> methods of the field's type (or method's return type), as well as those of its supertype except for all
+ methods declared in <code>java.lang.Object</code>.
</p>
<p>
You can pass any number of classes into the <code>@Delegate</code> annotation's <code>types</code> parameter.
If you do that, then lombok will delegate all <code>public</code> methods in those types (and their supertypes, except
- <code>java.lang.Object</code>) instead of looking at the field's type.
+ <code>java.lang.Object</code>) instead of looking at the field/method's type.
</p>
<p>
- All public non-Object methods that are part of the field's type (or, if you used <code>types</code> parameter, the methods of those types) are
+ All public non-<code>Object</code> 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 <code>@Delegate(excludes=SomeType.class)</code> parameter to exclude all public methods in the excluded type(s), and their supertypes.
</p>
@@ -59,6 +59,8 @@
<p>
When passing classes to the annotation, these classes do not need to be supertypes of the field. See the example.
</p>
+ <p>
+ <code>@Delegate</code> cannot be used on static fields or methods.
<div>
</div>
<div class="footer">