From ed61012f95cefae8d03260f506ffe34bc19bd90c Mon Sep 17 00:00:00 2001
From: Reinier Zwitserloot
Date: Mon, 18 Feb 2013 21:41:07 +0100
Subject: [PATCH] whoops, belated push and fixes to the documentation of onX
---
buildScripts/website.ant.xml | 6 +-
.../{ => experimental}/onXExample_post.jpage | 0
.../{ => experimental}/onXExample_pre.jpage | 6 +-
website/features/Constructor.html | 2 +-
website/features/GetterSetter.html | 2 +-
website/features/experimental/Value.html | 2 +-
website/features/experimental/Wither.html | 2 +-
website/features/experimental/index.html | 10 ++-
website/features/experimental/onX.html | 88 +++++++++++++++++++
website/features/onX.html | 71 ---------------
10 files changed, 104 insertions(+), 85 deletions(-)
rename usage_examples/{ => experimental}/onXExample_post.jpage (100%)
rename usage_examples/{ => experimental}/onXExample_pre.jpage (65%)
create mode 100644 website/features/experimental/onX.html
delete mode 100644 website/features/onX.html
diff --git a/buildScripts/website.ant.xml b/buildScripts/website.ant.xml
index 35e34367..78dc8ed7 100644
--- a/buildScripts/website.ant.xml
+++ b/buildScripts/website.ant.xml
@@ -145,9 +145,6 @@ such as converting the changelog into HTML, and creating javadoc.
-
-
-
@@ -163,6 +160,9 @@ such as converting the changelog into HTML, and creating javadoc.
+
+
+
diff --git a/usage_examples/onXExample_post.jpage b/usage_examples/experimental/onXExample_post.jpage
similarity index 100%
rename from usage_examples/onXExample_post.jpage
rename to usage_examples/experimental/onXExample_post.jpage
diff --git a/usage_examples/onXExample_pre.jpage b/usage_examples/experimental/onXExample_pre.jpage
similarity index 65%
rename from usage_examples/onXExample_pre.jpage
rename to usage_examples/experimental/onXExample_pre.jpage
index 2cc9c581..fa03e2cd 100644
--- a/usage_examples/onXExample_pre.jpage
+++ b/usage_examples/experimental/onXExample_pre.jpage
@@ -7,9 +7,9 @@ import javax.persistence.Id;
import javax.persistence.Column;
import javax.validation.constraints.Max;
-@AllArgsConstructor(onConstructor=@Inject)
+@AllArgsConstructor(onConstructor=@_(@Inject))
public class OnXExample {
- @Getter(onMethod={@Id, @Column(name="unique-id"})
- @Setter(onParam=@Max(10000))
+ @Getter(onMethod=@_({@Id, @Column(name="unique-id")}))
+ @Setter(onParam=@_(@Max(10000)))
private long unid;
}
diff --git a/website/features/Constructor.html b/website/features/Constructor.html
index 051d730e..cdd5b4e2 100644
--- a/website/features/Constructor.html
+++ b/website/features/Constructor.html
@@ -35,7 +35,7 @@
Such a static factory method will infer generics, unlike a normal constructor. This means your API users get write MapEntry.of("foo", 5) instead of the much longer
new MapEntry<String, Integer>("foo", 5).
- To put annotations on the generated constructor, you can use onConstructor={@AnnotationsHere}. For more details see the documentation on the onX feature.
+ To put annotations on the generated constructor, you can use onConstructor=@_({@AnnotationsHere}), but be careful; this is an experimental feature. For more details see the documentation on the onX feature.
Static fields are skipped by these annotations. Also, a @java.beans.ConstructorProperties annotation is added for all constructors with at least 1 argument,
which allows bean editor tools to call the generated constructors. @ConstructorProperties is now in Java 1.6, which means that if your code is intended for
diff --git a/website/features/GetterSetter.html b/website/features/GetterSetter.html
index dde3456b..03704119 100644
--- a/website/features/GetterSetter.html
+++ b/website/features/GetterSetter.html
@@ -29,7 +29,7 @@
You can always manually disable getter/setter generation for any field by using the special AccessLevel.NONE access level. This lets you override the
behaviour of a @Getter, @Setter or @Data annotation on a class.
- To put annotations on the generated method, you can use onMethod={@AnnotationsHere}; to put annotations on the only parameter of a generated setter method, you can use onParam={@AnnotationsHere}. For more details see the documentation on the onX feature.
+ To put annotations on the generated method, you can use onMethod=@_({@AnnotationsHere}); to put annotations on the only parameter of a generated setter method, you can use onParam=@_({@AnnotationsHere}). Be careful though! This is an experimental feature. For more details see the documentation on the onX feature.
diff --git a/website/features/experimental/Value.html b/website/features/experimental/Value.html
index a82808e2..fb726d7b 100644
--- a/website/features/experimental/Value.html
+++ b/website/features/experimental/Value.html
@@ -68,7 +68,7 @@
diff --git a/website/features/experimental/Wither.html b/website/features/experimental/Wither.html
index b0700aab..da2156cd 100644
--- a/website/features/experimental/Wither.html
+++ b/website/features/experimental/Wither.html
@@ -45,7 +45,7 @@
@Wither(level = AccessLevel.PROTECTED). Also like @Setter, you can also put a @Wither annotation on a type, which means
a 'wither' is generated for each field (even non-final fields).
- To put annotations on the generated method, you can use onMethod={@AnnotationsHere}; to put annotations on the only parameter of this method, you can use onParam={@AnnotationsHere}. For more details see the documentation on the onX feature.
+ To put annotations on the generated method, you can use onMethod=@_({@AnnotationsHere}); to put annotations on the only parameter of a generated wither method, you can use onParam=@_({@AnnotationsHere}). Be careful though! This is an experimental feature. For more details see the documentation on the onX feature.
diff --git a/website/features/experimental/index.html b/website/features/experimental/index.html
index acbbdbf6..24fbb541 100644
--- a/website/features/experimental/index.html
+++ b/website/features/experimental/index.html
@@ -24,14 +24,16 @@
@Accessors
- A more fluent API for getters and setters.
- @ExtensionMethod
+ @ExtensionMethod
- Annoying API? Fix it yourself: Add new methods to existing types!
- @FieldDefaults
+ @FieldDefaults
- New default field modifiers for the 21st century.
- @Wither
+ @Wither
- Immutable 'setters' - methods that create a clone but with one changed field.
- @Value
+ @Value
- Immutable classes made very easy.
+ onMethod= / onConstructor= / onParam
+ - Sup dawg, we heard you like annotations, so we put annotations in your annotations so you can annotate while you're annotating.