From af16ba23cd46fa3d3b096daa8d725df2b4d78976 Mon Sep 17 00:00:00 2001 From: ttzn Date: Wed, 24 Mar 2021 23:52:08 +0100 Subject: @StandardException feature working draft * move feature under experimental * replace ProviderFor with Provides * add doc material (to be completed) * add author --- .../features/experimental/StandardException.html | 36 ++++++++++++++++++++++ website/templates/features/experimental/index.html | 4 +++ .../StandardExceptionExample_post.jpage | 16 ++++++++++ .../StandardExceptionExample_pre.jpage | 5 +++ 4 files changed, 61 insertions(+) create mode 100644 website/templates/features/experimental/StandardException.html create mode 100644 website/usageExamples/StandardExceptionExample_post.jpage create mode 100644 website/usageExamples/StandardExceptionExample_pre.jpage (limited to 'website') diff --git a/website/templates/features/experimental/StandardException.html b/website/templates/features/experimental/StandardException.html new file mode 100644 index 00000000..25324c4b --- /dev/null +++ b/website/templates/features/experimental/StandardException.html @@ -0,0 +1,36 @@ +<#import "../_features.html" as f> + +<@f.scaffold title="@StandardException" + logline="TODO"> + <@f.history> +

+ @StandardException was introduced as an experimental feature in lombok v1.18.21. +

+ + + <@f.overview> +

+ This annotation is intended to be used on subclasses of java.util.Throwable. For each of the four constructors in Throwable, it will generate a corresponding constructor in the target class, that simply forwards its argument to its super-counterpart. +

+ If any of those constructors is manually overriden, it is simply skipped. This allows applying special treatment such as annotations. +

+ + + <@f.snippets name="StandardException" /> + + <@f.confKeys> +
+ lombok.standardException.addConstructorProperties = [true | false] (default: false) +
+ lombok.standardException.flagUsage = [warning | error] (default: not set) +
+ Lombok will flag any usage of @StandardException as a warning or error if configured. +
+ + + <@f.smallPrint> +

+ Although such situation is unlikely to occur, this annotation can technically be applied to any class for which all four expected constructors are defined in a superclass. +

+ + diff --git a/website/templates/features/experimental/index.html b/website/templates/features/experimental/index.html index 32590815..34dd3bb4 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 title="@StandardException" href="StandardException"> + TODO + <@f.confKeys> diff --git a/website/usageExamples/StandardExceptionExample_post.jpage b/website/usageExamples/StandardExceptionExample_post.jpage new file mode 100644 index 00000000..148603a9 --- /dev/null +++ b/website/usageExamples/StandardExceptionExample_post.jpage @@ -0,0 +1,16 @@ +public class ExampleException extends Exception { + public ExampleException() { + } + + public ExampleException(String message) { + super(message); + } + + public ExampleException(Throwable cause) { + super(cause); + } + + public ExampleException(String message, Throwable cause) { + super(message, cause); + } +} \ No newline at end of file diff --git a/website/usageExamples/StandardExceptionExample_pre.jpage b/website/usageExamples/StandardExceptionExample_pre.jpage new file mode 100644 index 00000000..8d85286c --- /dev/null +++ b/website/usageExamples/StandardExceptionExample_pre.jpage @@ -0,0 +1,5 @@ +import lombok.experimental.StandardException; + +@StandardException +public class ExampleException extends Exception { +} \ No newline at end of file -- cgit