diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2018-04-05 14:22:53 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2018-04-05 14:22:53 +0200 |
commit | 675699fccb27c664c8ef9d3ddad65e6935b36787 (patch) | |
tree | 8f4c9e52579eff0f56bc270f55472279ff745c54 /website | |
parent | c2f0736c5e6aa8153bd84062ee03f155babc2288 (diff) | |
parent | b6fb3c03fa35db3423ea4274f35d2c77859a3286 (diff) | |
download | lombok-675699fccb27c664c8ef9d3ddad65e6935b36787.tar.gz lombok-675699fccb27c664c8ef9d3ddad65e6935b36787.tar.bz2 lombok-675699fccb27c664c8ef9d3ddad65e6935b36787.zip |
Merge branch 'cheelio-FieldNameConstants'
Diffstat (limited to 'website')
-rw-r--r-- | website/templates/features/experimental/FieldNameConstants.html | 44 | ||||
-rw-r--r-- | website/templates/features/experimental/index.html | 4 |
2 files changed, 48 insertions, 0 deletions
diff --git a/website/templates/features/experimental/FieldNameConstants.html b/website/templates/features/experimental/FieldNameConstants.html new file mode 100644 index 00000000..05c57f84 --- /dev/null +++ b/website/templates/features/experimental/FieldNameConstants.html @@ -0,0 +1,44 @@ +<#import "../_features.html" as f> + +<@f.scaffold title="@FieldNameConstants" logline="Name... that... field! String constants for your field's names."> + <@f.history> + <p> + @FieldNameConstants was introduced as experimental feature in lombok v2.0.0. + </p> + </@f.history> + + <@f.experimental> + <ul> + <li> + New feature; unsure if this busts enough boilerplate. + </li> + </ul> + Current status: <em>neutral</em> - As a just-introduced feature we're still gathering feedback. + </@f.experimental> + + <@f.overview> + <p> + The <code>@FieldNameConstants</code> annotation generates string constants (fields marked <code>public static final</code>, of type <code>java.lang.String</code>) containing the field's name, as a string. This is useful for various marshalling and serialization frameworks. The constant field has the same as the field it represents, except with all uppercase letters, with underscores in front of the uppercase letters in the original field. If this results in the exact same name, the constant is not generated (a warning is generated instead). + </p><p> + The <code>public</code> access modifier can be changed via the parameter <code>level = AccessLevel.PACKAGE</code> for example. You can force a field to be skipped by supplying <code>level = AccessLevel.NONE</code>. + </p><p> + Can be applied to classes (in which case every field gets a constant), or to an individual field. + </p> + </@f.overview> + + <@f.snippets name="experimental/FieldNameConstants" /> + + <@f.confKeys> + <dt> + <code>lombok.fieldNameConstants.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> + </@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. Static fields are also skipped. + </p> + </@f.smallPrint> +</@f.scaffold> diff --git a/website/templates/features/experimental/index.html b/website/templates/features/experimental/index.html index 21e8fceb..d9d67219 100644 --- a/website/templates/features/experimental/index.html +++ b/website/templates/features/experimental/index.html @@ -62,6 +62,10 @@ <@main.feature title="@Helper" href="Helper"> With a little help from my friends... Helper methods for java. </@main.feature> + + <@main.feature title="@FieldNameConstants" href="FieldNameConstants"> + Name... that... field! String constants for your field's names. + </@main.feature> </div> <@f.confKeys> |