aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2018-11-12 21:30:23 +0100
committerReinier Zwitserloot <reinier@zwitserloot.com>2018-11-12 21:30:23 +0100
commit94d11d89a79d6cb417bac8261449c3f895f84990 (patch)
tree81ff9b488f3f716eee1f3b59429e70c348cba3d5
parentdb19327cb4b9f5a08665b85d4cb953118ce69c13 (diff)
downloadlombok-94d11d89a79d6cb417bac8261449c3f895f84990.tar.gz
lombok-94d11d89a79d6cb417bac8261449c3f895f84990.tar.bz2
lombok-94d11d89a79d6cb417bac8261449c3f895f84990.zip
[issue #1938] addressing some small issues with the documentation.
-rw-r--r--website/templates/features/GetterSetter.html4
-rw-r--r--website/templates/features/NonNull.html4
-rw-r--r--website/templates/features/constructor.html4
-rw-r--r--website/templates/features/experimental/FieldNameConstants.html2
-rw-r--r--website/usageExamples/experimental/FieldNameConstantsExample_post.jpage5
-rw-r--r--website/usageExamples/experimental/FieldNameConstantsExample_pre.jpage2
6 files changed, 15 insertions, 6 deletions
diff --git a/website/templates/features/GetterSetter.html b/website/templates/features/GetterSetter.html
index 04cd1ec7..a429c9ac 100644
--- a/website/templates/features/GetterSetter.html
+++ b/website/templates/features/GetterSetter.html
@@ -45,6 +45,10 @@
<code>lombok.getter.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set)
</dt><dd>
Lombok will flag any usage of <code>@Getter</code> as a warning or error if configured.
+ </dd><dt>
+ <code>lombok.copyableAnnotations</code> = [<em>A list of fully qualified types</em>] (default: empty list)
+ </dt><dd>
+ Lombok will copy any of these annotations from the field to the setter parameter, and to the getter method. Note that lombok ships with a bunch of annotations 'out of the box' which are known to be copyable: All popular nullable/nonnull annotations.
</dd>
</@f.confKeys>
diff --git a/website/templates/features/NonNull.html b/website/templates/features/NonNull.html
index 3d99a3c7..66ab2fc2 100644
--- a/website/templates/features/NonNull.html
+++ b/website/templates/features/NonNull.html
@@ -9,7 +9,7 @@
<p>
You can use <code>@NonNull</code> on the parameter of a method or constructor to have lombok generate a null-check statement for you.
</p><p>
- Lombok has always treated any annotation named <code>@NonNull</code> on a field as a signal to generate a null-check if lombok generates an entire method or constructor for you, via for example <a href="/features/Data"><code>@Data</code></a>. Now, however, using lombok's own <code>@lombok.NonNull</code> on a parameter results in the insertion of just the null-check statement inside your own method or constructor.
+ Lombok has always treated various annotations generally named <code>@NonNull</code> on a field as a signal to generate a null-check if lombok generates an entire method or constructor for you, via for example <a href="/features/Data"><code>@Data</code></a>. Now, however, using lombok's own <code>@lombok.NonNull</code> on a parameter results in the insertion of just the null-check statement inside your own method or constructor.
</p><p>
The null-check looks like <code>if (param == null) throw new NullPointerException("param is marked @NonNull but is null");</code> and will be inserted at the very top of your method. For constructors, the null-check will be inserted immediately following any explicit <code>this()</code> or <code>super()</code> calls.
</p><p>
@@ -35,7 +35,7 @@
<p>
Lombok's detection scheme for already existing null-checks consists of scanning for if statements that look just like lombok's own. Any 'throws' statement as the 'then' part of the if statement, whether in braces or not, counts. The conditional of the if statement <em>must</em> look exactly like <code>PARAMNAME == null</code>. The first statement in your method that is not such a null-check stops the process of inspecting for null-checks.
</p><p>
- While <code>@Data</code> and other method-generating lombok annotations will trigger on any annotation named <code>@NonNull</code> regardless of casing or package name, this feature only triggers on lombok's own <code>@NonNull</code> annotation from the <code>lombok</code> package.
+ While <code>@Data</code> and other method-generating lombok annotations will trigger on various well-known annotations that signify the field must never be <code>@NonNull</code>, this feature only triggers on lombok's own <code>@NonNull</code> annotation from the <code>lombok</code> package.
</p><p>
A <code>@NonNull</code> on a primitive parameter results in a warning. No null-check will be generated.
</p><p>
diff --git a/website/templates/features/constructor.html b/website/templates/features/constructor.html
index b1f25321..02380319 100644
--- a/website/templates/features/constructor.html
+++ b/website/templates/features/constructor.html
@@ -38,6 +38,10 @@
<code>lombok.anyConstructor.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set)
</dt><dd>
Lombok will flag any usage of any of the 3 constructor-generating annotations as a warning or error if configured.
+ </dd><dt>
+ <code>lombok.copyableAnnotations</code> = [<em>A list of fully qualified types</em>] (default: empty list)
+ </dt><dd>
+ Lombok will copy any of these annotations from the field to the constructor parameter, the setter parameter, and the getter method. Note that lombok ships with a bunch of annotations 'out of the box' which are known to be copyable: All popular nullable/nonnull annotations.
</dd>
</@f.confKeys>
diff --git a/website/templates/features/experimental/FieldNameConstants.html b/website/templates/features/experimental/FieldNameConstants.html
index 283ebe55..50faf804 100644
--- a/website/templates/features/experimental/FieldNameConstants.html
+++ b/website/templates/features/experimental/FieldNameConstants.html
@@ -44,7 +44,7 @@
<@f.smallPrint>
<p>
- Starting with lombok v1.18.5, lombok will silently skip generating anything that already exists. You can define the inner <code>Fields</code> enum/class yourself,
+ Starting with lombok v1.18.6, lombok will silently skip generating anything that already exists. You can define the inner <code>Fields</code> enum/class yourself,
in which case lombok will add all the enum constants / public static final fields you haven't written yourself.
</p><p>
From lombok v1.16.22 to lombok v1.18.2, this feature generated constants inside the type directly; the name of these fields would for example turn field <code>exampleFieldName</code> into <code>public static final String FIELD_EXAMPLE_FIELD_NAME = "exampleFieldName";</code>. The prefix and suffix (here, <code>FIELD_</code>, and the empty string) were configurable. Starting with lombok v1.18.4 this feature has been redesigned into generating an inner type as described above.
diff --git a/website/usageExamples/experimental/FieldNameConstantsExample_post.jpage b/website/usageExamples/experimental/FieldNameConstantsExample_post.jpage
index 3a311746..e1366734 100644
--- a/website/usageExamples/experimental/FieldNameConstantsExample_post.jpage
+++ b/website/usageExamples/experimental/FieldNameConstantsExample_post.jpage
@@ -1,9 +1,10 @@
public class FieldNameConstantsExample {
private final String iAmAField;
private final int andSoAmI;
+ private final int asAmI;
public static final class Fields {
- public static final String iAmAField = "IAmAField";
- static final String andSoAmI = "andSoAmI";
+ public static final String iAmAField = "iAmAField";
+ public static final String andSoAmI = "andSoAmI";
}
}
diff --git a/website/usageExamples/experimental/FieldNameConstantsExample_pre.jpage b/website/usageExamples/experimental/FieldNameConstantsExample_pre.jpage
index dc6376eb..b462867b 100644
--- a/website/usageExamples/experimental/FieldNameConstantsExample_pre.jpage
+++ b/website/usageExamples/experimental/FieldNameConstantsExample_pre.jpage
@@ -4,6 +4,6 @@ import lombok.AccessLevel;
@FieldNameConstants
public class FieldNameConstantsExample {
private final String iAmAField;
- @FieldNameConstants(level = AccessLevel.PACKAGE)
private final int andSoAmI;
+ @FieldNameConstants.Exclude private final int asAmI;
}