aboutsummaryrefslogtreecommitdiff
path: root/website/features/Delegate.html
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2012-01-19 00:42:15 +0100
committerReinier Zwitserloot <reinier@zwitserloot.com>2012-01-19 00:44:48 +0100
commit0774cf929ca3746db650563b74bebeab11af19fa (patch)
treee6df832bf593a9bfe56375cca7ea890ca9722f2d /website/features/Delegate.html
parentacea9efcff67c7a0bdb85175b84e75a9dad172b8 (diff)
downloadlombok-0774cf929ca3746db650563b74bebeab11af19fa.tar.gz
lombok-0774cf929ca3746db650563b74bebeab11af19fa.tar.bz2
lombok-0774cf929ca3746db650563b74bebeab11af19fa.zip
updated documentation to reflect ability of putting delegate on methods.
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">