aboutsummaryrefslogtreecommitdiff
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
parentacea9efcff67c7a0bdb85175b84e75a9dad172b8 (diff)
downloadlombok-0774cf929ca3746db650563b74bebeab11af19fa.tar.gz
lombok-0774cf929ca3746db650563b74bebeab11af19fa.tar.bz2
lombok-0774cf929ca3746db650563b74bebeab11af19fa.zip
updated documentation to reflect ability of putting delegate on methods.
-rw-r--r--doc/changelog.markdown1
-rw-r--r--website/features/Delegate.html14
2 files changed, 9 insertions, 6 deletions
diff --git a/doc/changelog.markdown b/doc/changelog.markdown
index 7db9be55..baadbb9f 100644
--- a/doc/changelog.markdown
+++ b/doc/changelog.markdown
@@ -2,6 +2,7 @@ Lombok Changelog
----------------
### v0.10.7 (edge)
+* FEATURE: `@Delegate` can now be used on a no-argument method, which works similarly to adding it to fields. See [documentation](http://projectlombok.org/features/Delegate.html).
* REGRESSION: Eclipse save action *Add final modifier to private fields* again adds final keyword to `@Setter` fields, caused by fix to [issue #325](http://code.google.com/p/projectlombok/issues/detail?id=325). Reopened [Issue #263](http://code.google.com/p/projectlombok/issues/detail?id=263)
* BUGFIX: Eclipse refactoring Extract Interface was broken when using lombok annotation to generate methods. [Issue #86](http://code.google.com/p/projectlombok/issues/detail?id=86)
* BUGFIX: Eclipse action Sort Members was broken when using lombok annotations to generate methods or fields. [Issue #265](http://code.google.com/p/projectlombok/issues/detail?id=265)
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">