diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2018-11-12 21:30:23 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2018-11-12 21:30:23 +0100 |
commit | 94d11d89a79d6cb417bac8261449c3f895f84990 (patch) | |
tree | 81ff9b488f3f716eee1f3b59429e70c348cba3d5 /website/templates/features | |
parent | db19327cb4b9f5a08665b85d4cb953118ce69c13 (diff) | |
download | lombok-94d11d89a79d6cb417bac8261449c3f895f84990.tar.gz lombok-94d11d89a79d6cb417bac8261449c3f895f84990.tar.bz2 lombok-94d11d89a79d6cb417bac8261449c3f895f84990.zip |
[issue #1938] addressing some small issues with the documentation.
Diffstat (limited to 'website/templates/features')
4 files changed, 11 insertions, 3 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. |