aboutsummaryrefslogtreecommitdiff
path: root/website/templates/features/experimental/FieldDefaults.html
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2017-05-08 21:28:02 +0200
committerReinier Zwitserloot <reinier@zwitserloot.com>2017-05-29 21:02:54 +0200
commit8b7a7cbc813653a3248d6cf3a7779e220957bc85 (patch)
treeb9acfb9d68c6866acc3cfb9ee59d72ff43f1ebc3 /website/templates/features/experimental/FieldDefaults.html
parent72fd50b9f1db1ab6bfc1753ba6a1e686a2f0f22c (diff)
downloadlombok-8b7a7cbc813653a3248d6cf3a7779e220957bc85.tar.gz
lombok-8b7a7cbc813653a3248d6cf3a7779e220957bc85.tar.bz2
lombok-8b7a7cbc813653a3248d6cf3a7779e220957bc85.zip
The great rename: the old ‘website’ is now ‘website-old’, and ‘website2’ is now ‘website’.
Diffstat (limited to 'website/templates/features/experimental/FieldDefaults.html')
-rw-r--r--website/templates/features/experimental/FieldDefaults.html56
1 files changed, 56 insertions, 0 deletions
diff --git a/website/templates/features/experimental/FieldDefaults.html b/website/templates/features/experimental/FieldDefaults.html
new file mode 100644
index 00000000..0d4cda9e
--- /dev/null
+++ b/website/templates/features/experimental/FieldDefaults.html
@@ -0,0 +1,56 @@
+<#import "../_features.html" as f>
+
+<@f.scaffold title="@FieldDefaults" logline="New default field modifiers for the 21st century.">
+ <@f.history>
+ <p>
+ @FieldDefaults was introduced as experimental feature in lombok v0.11.4.
+ </p>
+ </@f.history>
+
+ <@f.experimental>
+ <ul>
+ <li>
+ New feature; unsure if this busts enough boilerplate.
+ </li><li>
+ Would be nice if you could stick this on the package-info.java package to set the default for all classes in that package.
+ </li><li>
+ Part of the work on @Value, which is experimental.
+ </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>
+
+ <@f.overview>
+ <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 (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 (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>
+
+ <@f.snippets name="experimental/FieldDefaults" />
+
+ <@f.confKeys>
+ <dt>
+ <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>
+
+ <@f.smallPrint>
+ <p>
+ Like other lombok handlers that touch fields, any field whose name starts with a dollar (<code>$</code>) symbol is skipped entirely. Such a field will not be modified at all.
+ </p>
+ </@f.smallPrint>
+</@f.scaffold>