diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2017-01-06 01:21:28 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2017-05-29 21:01:53 +0200 |
commit | a24bf3194477a841c905827ef625e19b0fd53b2a (patch) | |
tree | e0cf9ef16bd9f8cac8b7953e193980beff9d733e /website2/templates/features/experimental | |
parent | bb85d799b3ba549c8a29afab0b246cb13b10507a (diff) | |
download | lombok-a24bf3194477a841c905827ef625e19b0fd53b2a.tar.gz lombok-a24bf3194477a841c905827ef625e19b0fd53b2a.tar.bz2 lombok-a24bf3194477a841c905827ef625e19b0fd53b2a.zip |
feature pages updated and made more consistent.
Diffstat (limited to 'website2/templates/features/experimental')
5 files changed, 66 insertions, 14 deletions
diff --git a/website2/templates/features/experimental/FieldDefaults.html b/website2/templates/features/experimental/FieldDefaults.html index 77ed37b6..0d4cda9e 100644 --- a/website2/templates/features/experimental/FieldDefaults.html +++ b/website2/templates/features/experimental/FieldDefaults.html @@ -24,9 +24,9 @@ <p> The <code>@FieldDefaults</code> annotation can add an access modifier (<code>public</code>, <code>private</code>, or <code>protected</code>) to each field in the annotated class or enum. It can also add <code>final</code> to each field in the annotated class or enum. </p><p> - To add <code>final</code> to each field, use <code>@FieldDefaults(makeFinal=true)</code>. Any non-final field which must remain nonfinal can be annotated with <code>@NonFinal</code> (also in the <code>lombok.experimental</code> package). + To add <code>final</code> to each (instance) field, use <code>@FieldDefaults(makeFinal=true)</code>. Any non-final field which must remain nonfinal can be annotated with <code>@NonFinal</code> (also in the <code>lombok.experimental</code> package). </p><p> - To add an access modifier to each field, use <code>@FieldDefaults(level=AccessLevel.PRIVATE)</code>. Any field that does not already have an access modifier (i.e. any field that looks like package private access) is changed to have the appropriate access modifier. Any package private field which must remain package private can be annotated with <code>@PackagePrivate</code> (also in the <code>lombok.experimental</code> package). + To add an access modifier to each (instance) field, use <code>@FieldDefaults(level=AccessLevel.PRIVATE)</code>. Any field that does not already have an access modifier (i.e. any field that looks like package private access) is changed to have the appropriate access modifier. Any package private field which must remain package private can be annotated with <code>@PackagePrivate</code> (also in the <code>lombok.experimental</code> package). </p> </@f.overview> @@ -37,6 +37,14 @@ <code>lombok.fieldDefaults.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) </dt><dd> Lombok will flag any usage of <code>@FieldDefaults</code> as a warning or error if configured. + </dd><dt> + <code>lombok.fieldDefautls.defaultPrivate</code> = [<code>true</code> | <code>false</code>] (default: false) + </dt><dd> + (Since 1.16.8) If set to <code>true</code>, <em>every</em> field in <em>every</em> class or enum anywhere in the sources being compiled will be marked as <code>private</code> unless it has an explicit access modifier or the <code>@PackagePrivate</code> annotation, or an explicit <code>@FieldDefaults</code> annotation is present to override this config key. + </dd><dt> + <code>lombok.fieldDefaults.defaultFinal</code> = [<code>true</code> | <code>false</code>] (default: false) + </dt><dd> + (Since 1.16.8) If set to <code>true</code>, <em>every</em> field in <em>every</em> class or enum anywhere in the sources being compiled will be marked as <code>final</code> unless it has the <code>@NonFinal</code> annotation, or an explicit <code>@FieldDefaults</code> annotation is present to override this config key. </dd> </@f.confKeys> diff --git a/website2/templates/features/experimental/UtilityClass.html b/website2/templates/features/experimental/UtilityClass.html index 8145437a..4cee3657 100644 --- a/website2/templates/features/experimental/UtilityClass.html +++ b/website2/templates/features/experimental/UtilityClass.html @@ -9,7 +9,9 @@ <@f.experimental> <ul> - <li>Some debate as to whether its common enough to count as boilerplate.</li> + <li> + Some debate as to whether its common enough to count as boilerplate. + </li> </ul> Current status: <em>positive</em> - Currently we feel this feature may move out of experimental status with no or minor changes soon. </@f.experimental> diff --git a/website2/templates/features/experimental/index.html b/website2/templates/features/experimental/index.html index 257c0382..65cefd4c 100644 --- a/website2/templates/features/experimental/index.html +++ b/website2/templates/features/experimental/index.html @@ -25,35 +25,39 @@ </p> </div> <div class="row"> - <@main.feature title="@Accessors" code="/features/experimental/Accessors"> + <@main.feature title="var" href="var"> + Modifiable local variables with a type inferred by assigning value. + </@main.feature> + + <@main.feature title="@Accessors" href="Accessors"> A more fluent API for getters and setters. </@main.feature> - <@main.feature title="@ExtensionMethod" code="/features/experimental/ExtensionMethod"> + <@main.feature title="@ExtensionMethod" href="ExtensionMethod"> Annoying API? Fix it yourself: Add new methods to existing types! </@main.feature> - <@main.feature title="@FieldDefaults" code="/features/experimental/FieldDefaults"> + <@main.feature title="@FieldDefaults" href="FieldDefaults"> New default field modifiers for the 21st century. </@main.feature> - <@main.feature title="@Delegate" code="/features/experimental/Delegate"> + <@main.feature title="@Delegate" href="Delegate"> Don't lose your composition. </@main.feature> - <@main.feature title="@Wither" code="/features/experimental/Wither"> + <@main.feature title="@Wither" href="Wither"> Immutable 'setters' - methods that create a clone but with one changed field. </@main.feature> - <@main.feature title="onMethod= / onConstructor= / onParam=" code="/features/experimental/onX"> + <@main.feature title="onMethod= / onConstructor= / onParam=" href="onX"> Sup dawg, we heard you like annotations, so we put annotations in your annotations so you can annotate while you're annotating. </@main.feature> - <@main.feature title="@UtilityClass" code="/features/experimental/UtilityClass"> + <@main.feature title="@UtilityClass" href="UtilityClass"> Utility, metility, wetility! Utility classes for the masses. </@main.feature> - <@main.feature title="@Helper" code="/features/experimental/Helper"> + <@main.feature title="@Helper" href="Helper"> With a little help from my friends... Helper methods for java. </@main.feature> </div> @@ -69,10 +73,10 @@ <div class="row"> <h3 class="text-center">Putting the "Ex" in "Experimental": promoted or deleted experimental features.</h3> <div class="row"> - <@main.feature title="@Value: promoted" code="/features/Value"> + <@main.feature title="@Value: promoted" href="../Value"> <code>@Value</code> has proven its value and has been moved to the main package. </@main.feature> - <@main.feature title="@Builder: promoted" code="/features/Builder"> + <@main.feature title="@Builder: promoted" href="../Builder"> <code>@Builder</code> is a solid base to build APIs on, and has been moved to the main package. </@main.feature> </div> diff --git a/website2/templates/features/experimental/onX.html b/website2/templates/features/experimental/onX.html index 7398ce70..8e07f0ac 100644 --- a/website2/templates/features/experimental/onX.html +++ b/website2/templates/features/experimental/onX.html @@ -9,7 +9,8 @@ <@f.experimental> <ul> - <li>Ugly syntax. The syntax of this feature is not optimal, but it is the least convoluted syntax that could possibly work (for now!) + <li> + Ugly syntax. The syntax of this feature is not optimal, but it is the least convoluted syntax that could possibly work (for now!) </li><li> Possibly java 9 will offer (much) better ways of supporting this feature. </li><li> diff --git a/website2/templates/features/experimental/var.html b/website2/templates/features/experimental/var.html new file mode 100644 index 00000000..fa35ac5e --- /dev/null +++ b/website2/templates/features/experimental/var.html @@ -0,0 +1,37 @@ +<#import "../_features.html" as f> + +<@f.scaffold title="var" logline="Modifiable local variables with a type inferred by assigning value."> + <@f.history> + <p> + <code>var</code> was introduced in lombok 1.16.12 as experimental feature. + </p> + </@f.history> + + <@f.experimental> + <ul> + <li> + This feature is very controversial. + </li><li> + There is <a href="http://openjdk.java.net/jeps/286">JEP 286</a> that should make <code>var</code> obsolete. + </li> + </ul> + Current status: <em>uncertain</em> – Currently we feel this feature cannot move out of experimental status. + </@f.experimental> + + <@f.overview> + <p> + <code>var</code> works exactly like <a href="/features/val"><code>val</code></a>, except the local variable is <em>not</em> marked as <code>final</code>. + </p><p> + The type is still entirely derived from the mandatory initializer expression, and any further assignments, while now legal (because the variable is no longer <code>final</code>), aren't looked at to determine the appropriate type.<br /> + For example, <code>var x = "Hello"; x = Color.RED;</code> does <em>not</em> work; the type of x will be inferred to be <code>java.lang.String</code> and thus, the <code>x = Color.RED</code> assignment will fail. If the type of <code>x</code> was inferred to be <code>java.lang.Object</code> this code would have compiled, but that's not how<code>var</code> works. + </p> + </@f.overview> + + <@f.confKeys> + <dt> + <code>lombok.var.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of <code>var</code> as a warning or error if configured. + </dd> + </@f.confKeys> +</@f.scaffold> |