diff options
Diffstat (limited to 'website/templates')
-rw-r--r-- | website/templates/all-versions.html | 2 | ||||
-rw-r--r-- | website/templates/features/NonNull.html | 6 | ||||
-rw-r--r-- | website/templates/features/experimental/StandardException.html | 53 | ||||
-rw-r--r-- | website/templates/features/experimental/index.html | 4 | ||||
-rw-r--r-- | website/templates/order-license.html | 8 |
5 files changed, 65 insertions, 8 deletions
diff --git a/website/templates/all-versions.html b/website/templates/all-versions.html index db48f664..dee1aef8 100644 --- a/website/templates/all-versions.html +++ b/website/templates/all-versions.html @@ -13,7 +13,7 @@ <#list linksToVersions as lnk> <div class="row"> <icon class="fa fa-download"></icon> - <a class="oldVersion" href="${lnk[0]}">${lnk[1]}</a> + <a class="oldVersion" href="${lnk[1]}">${lnk[0]}</a> </div> </#list> <div class="row"> diff --git a/website/templates/features/NonNull.html b/website/templates/features/NonNull.html index 67cc262c..57aa62fe 100644 --- a/website/templates/features/NonNull.html +++ b/website/templates/features/NonNull.html @@ -7,11 +7,11 @@ <@f.overview> <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. + You can use <code>@NonNull</code> on a record component, or a parameter of a method or constructor. This will cause to lombok generate a null-check statement for you. </p><p> - 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. + 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>. However, using lombok's own <code>@lombok.NonNull</code> on a parameter or record component results in the insertion of the null-check at the top of that method. </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. + 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. For record components, the null-check will be inserted in the 'compact constructor' (the one that has no argument list at all), which will be generated if you have no constructor. If you have written out the record constructor in long form (with parameters matching your components exactly), then nothing happens - you'd have to annotate the parameters of this long-form constructor instead. </p><p> If a null-check is already present at the top, no additional null-check will be generated. </p> diff --git a/website/templates/features/experimental/StandardException.html b/website/templates/features/experimental/StandardException.html new file mode 100644 index 00000000..1484154d --- /dev/null +++ b/website/templates/features/experimental/StandardException.html @@ -0,0 +1,53 @@ +<#import "../_features.html" as f> + +<@f.scaffold title="@StandardException" + logline="TODO"> + <@f.history> + <p> + <code>@StandardException</code> was introduced as an experimental feature in lombok v1.18.21. + </p> + </@f.history> + + <@f.overview> + <p> + Put this annotation on your own exception types (new classes that <code>extends Exception</code> or anything else that inherits from <code>Throwable</code>. This annotation will then generate up to 4 constructors: + </p><ul> + <li>A no-args constructor (<code>MyException()</code>), representing no message, and no cause.</li> + <li>A message-only constructor (<code>MyException(String message)</code>), representing the provided message, and no cause.</li> + <li>A cause-only constructor (<code>MyException(Throwable cause)</code>), which will copy the message from the cause, if there is one, and uses the provided cause.</li> + <li>A full constructor (<code>MyException(String message, Throwable cause)</code>).</li> + </ul> + <p> + Each constructor forwards to the full constructor; you can write any or all of these constructors manually in which case lombok + will not generate it. The full constructor, if it needs to be generated, will invoke <code>super(message);</code> and will then + invoke <code>super.initCause(cause);</code> if the cause is not null. + </p><p> + There are few reasons <em>not</em> to put this annotation on all your custom exceptions. + </p> + </@f.overview> + + <@f.snippets name="StandardException" /> + + <@f.confKeys> + <dt> + <code>lombok.standardException.addConstructorProperties</code> = [<code>true</code> | <code>false</code>] (default: <code>false</code>) + </dt><dt> + <code>lombok.standardException.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of <code>@StandardException</code> as a warning or error if configured. + </dd> + </@f.confKeys> + + <@f.smallPrint> + <p> + Lombok will not check if you extend an actual exception type. + </p><p> + Lombok does not require that the class you inherit from has the <code>Throwable cause</code> variants, because not all exceptions + have these. However, the `<code>Parent(String message)</code>` constructor as well as the no-args constructor <em>must</em> exist. + </p><p> + There is a very slight functional difference: Normally, invoking <code>new SomeException(message, null)</code> will initialize + the cause to be <em>no cause</em>, and this cannot be later changed by invoking <code>initCause</code>. However, lombok's + standard exceptions <strong>do</strong> let you overwrite an explicit no-cause with <code>initCause</code> later. + </p> + </@f.smallPrint> +</@f.scaffold> diff --git a/website/templates/features/experimental/index.html b/website/templates/features/experimental/index.html index 32590815..a8430d8d 100644 --- a/website/templates/features/experimental/index.html +++ b/website/templates/features/experimental/index.html @@ -75,6 +75,10 @@ <@main.feature title="@Jacksonized" href="Jacksonized"> Bob, meet Jackson. Lets make sure you become fast friends. </@main.feature> + + <@main.feature title="@StandardException" href="StandardException"> + Standard.. Exceptional? This is not just an oxymoron, it's convenient! + </@main.feature> </div> <@f.confKeys> diff --git a/website/templates/order-license.html b/website/templates/order-license.html index c3f52cef..1feacbbc 100644 --- a/website/templates/order-license.html +++ b/website/templates/order-license.html @@ -28,21 +28,21 @@ <div class="form-check"> <label class="form-check-label"> <input type="radio" class="form-check-input licenseType" name="licenseType" value="professional" checked="checked" /> - Professional (€2,- per developer per month; ~ $2.50). + Professional (€2,- per developer per month; ~ $2.40). </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="radio" class="form-check-input licenseType" name="licenseType" value="enterprise" /> - Enterprise (€5,- per developer per month; ~ $6.10). + Enterprise (€5,- per developer per month; ~ $6.00). </label> </div> </div> <div id="licenseTypeErr" class="formErr" hidden="hidden">License type is a required field.</div> <div class="form-group"> - <label for="seats"># of developers using lombok</label> + <label for="seats"># of developers using lombok (minimum: 10)</label> <input type="number" placeholder="# of developers" class="form-control" id="seats" /> - <div id="seatsErr" class="formErr" hidden="hidden">We need to know the # of developers to determine the license price.</div> + <div id="seatsErr" class="formErr" hidden="hidden">We need to know the # of developers to determine the license price, and that # needs to be at least 10.</div> </div> </fieldset> <fieldset class="form-group"> |