-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
@StandardException feature working draft
* move feature under experimental * replace ProviderFor with Provides * add doc material (to be completed) * add author
- Loading branch information
Showing
9 changed files
with
74 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
@lombok.StandardException class EmptyException extends Exception { | ||
import lombok.experimental.StandardException; | ||
|
||
@StandardException class EmptyException extends Exception { | ||
} | ||
@lombok.StandardException class NoArgsException extends Exception { | ||
@StandardException class NoArgsException extends Exception { | ||
public NoArgsException() { | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
website/templates/features/experimental/StandardException.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<#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> | ||
This annotation is intended to be used on subclasses of <code>java.util.Throwable</code>. For each of the four constructors in <code>Throwable</code>, it will generate a corresponding constructor in the target class, that simply forwards its argument to its super-counterpart. | ||
</p><p> | ||
If any of those constructors is manually overriden, it is simply skipped. This allows applying special treatment such as annotations. | ||
</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> | ||
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. | ||
</p> | ||
</@f.smallPrint> | ||
</@f.scaffold> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import lombok.experimental.StandardException; | ||
|
||
@StandardException | ||
public class ExampleException extends Exception { | ||
} |