diff options
author | Michael Ernst <mernst@cs.washington.edu> | 2021-12-07 11:16:11 -0800 |
---|---|---|
committer | Michael Ernst <mernst@cs.washington.edu> | 2021-12-07 11:16:11 -0800 |
commit | 3f5e4a2819d2f03d634a06861ff5487af320b719 (patch) | |
tree | ba9ab7ba2f582bb179624e2bb3f717bea5d9a421 /website | |
parent | 0b4cc60c2367845ebc362e4b254f9e96a66d53c3 (diff) | |
parent | d3b763f9dab4a46e88ff10bc2132fb6f12fda639 (diff) | |
download | lombok-3f5e4a2819d2f03d634a06861ff5487af320b719.tar.gz lombok-3f5e4a2819d2f03d634a06861ff5487af320b719.tar.bz2 lombok-3f5e4a2819d2f03d634a06861ff5487af320b719.zip |
Merge ../lombok-branch-master into nullness-annotations
Diffstat (limited to 'website')
-rw-r--r-- | website/templates/features/GetterSetter.html | 5 | ||||
-rw-r--r-- | website/templates/features/Value.html | 2 | ||||
-rw-r--r-- | website/templates/features/With.html | 9 | ||||
-rw-r--r-- | website/templates/features/experimental/Accessors.html | 12 | ||||
-rw-r--r-- | website/templates/features/experimental/FieldNameConstants.html | 2 | ||||
-rw-r--r-- | website/templates/features/val.html | 3 | ||||
-rw-r--r-- | website/usageExamples/ValueExample_pre.jpage | 4 |
7 files changed, 30 insertions, 7 deletions
diff --git a/website/templates/features/GetterSetter.html b/website/templates/features/GetterSetter.html index a429c9ac..8b16d34d 100644 --- a/website/templates/features/GetterSetter.html +++ b/website/templates/features/GetterSetter.html @@ -38,6 +38,11 @@ </dt><dd> If set to <code>true</code>, getters generated for <code>boolean</code> fields will use the <code>get</code> prefix instead of the default<code>is</code> prefix, and any generated code that calls getters, such as <code>@ToString</code>, will also use <code>get</code> instead of <code>is</code> </dd><dt> + <code>lombok.accessors.capitalization</code> = [<code>basic</code> | <code>beanspec</code>] (default: basic) + </dt><dd> + Controls how tricky cases like <code>uShaped</code> (one lowercase letter followed by an upper/titlecase letter) are capitalized. <code>basic</code> capitalizes that to <code>getUShaped</code>, and <code>beanspec</code> capitalizes that to <code>getuShaped</code> instead.<br /> + Both strategies are commonly used in the java ecosystem, though <code>beanspec</code> is more common. + </dd><dt> <code>lombok.setter.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) </dt><dd> Lombok will flag any usage of <code>@Setter</code> as a warning or error if configured. diff --git a/website/templates/features/Value.html b/website/templates/features/Value.html index c41b6b10..e128383f 100644 --- a/website/templates/features/Value.html +++ b/website/templates/features/Value.html @@ -5,7 +5,7 @@ <p> <code>@Value</code> was introduced as experimental feature in lombok v0.11.4. </p><p> - <code>@Value</code> no longer implies <code>@Wither</code> since lombok v0.11.8. + <code>@Value</code> no longer implies <code>@With</code> since lombok v0.11.8. </p><p> <code>@Value</code> promoted to the main <code>lombok</code> package since lombok v0.12.0. </p> diff --git a/website/templates/features/With.html b/website/templates/features/With.html index 8b34f038..867c17eb 100644 --- a/website/templates/features/With.html +++ b/website/templates/features/With.html @@ -27,6 +27,15 @@ <@f.snippets name="With" /> <@f.confKeys> + <><dt> + <code>lombok.accessors.prefix</code> += <em>a field prefix</em> (default: empty list) + </dt><dd> + This is a list property; entries can be added with the <code>+=</code> operator. Inherited prefixes from parent config files can be removed with the <code>-=</code> operator. Lombok will strip any matching field prefix from the name of a field in order to determine the name of the getter/setter to generate. For example, if <code>m</code> is one of the prefixes listed in this setting, then a field named <code>mFoobar</code> will result in a getter named <code>getFoobar()</code>, not <code>getMFoobar()</code>. An explicitly configured <code>prefix</code> parameter of an <a href="/features/experimental/Accessors"><code>@Accessors</code></a> annotation takes precedence over this setting. + </dd><dt> + <code>lombok.accessors.capitalization</code> = [<code>basic</code> | <code>beanspec</code>] (default: basic) + </dt><dd> + Controls how tricky cases like <code>uShaped</code> (one lowercase letter followed by an upper/titlecase letter) are capitalized. <code>basic</code> capitalizes that to <code>withUShaped</code>, and <code>beanspec</code> capitalizes that to <code>withuShaped</code> instead.<br /> + Both strategies are commonly used in the java ecosystem, though <code>beanspec</code> is more common. <dt> <code>lombok.with.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) </dt><dd> diff --git a/website/templates/features/experimental/Accessors.html b/website/templates/features/experimental/Accessors.html index 564ab66d..9a9385cb 100644 --- a/website/templates/features/experimental/Accessors.html +++ b/website/templates/features/experimental/Accessors.html @@ -4,9 +4,11 @@ <@f.history> <p> <code>@Accessors</code> was introduced as experimental feature in lombok v0.11.0. + </p><p> + The <em>lombok.config</em> option <code>lombok.accessors.capitalization</code> = [<code>basic</code> | <code>beanspec</code>] was added in lombok v1.18.24. </p> </@f.history> - + <@f.experimental> <ul> <li> @@ -17,7 +19,6 @@ </ul> Current status: <em>neutral</em> - Some changes are expected. These changes are intended to be backwards compatible, but should start in an experimental feature: <ul> - <li>Open feature request: naming behaviour for properties that start with a lowercase letter followed by an uppercase letter. Half of specs, tools and lombok users prefer that a field named <code>uLimit</code> into <code>getULimit</code> (including lombok) and the other half turn prefer <code>getuLimit</code>. <code>@Accessors</code> may be involved in any update that addresses this <a href="https://github.com/projectlombok/lombok/issues/2693">request</a>.</li> <li>Open feature request: More control over naming accessors; for example to address creatively named boolean properties: Turn <code>boolean wasRunning</code> into <code>boolean wasRunning()</code> instead of <code>boolean isWasRunning()</code>, as well as more expansive prefix support. <code>@Accessors</code> will be involved if this feature <a href="https://github.com/projectlombok/lombok/issues/2464">request</a> is addressed.</li> <li><code>@Accessors</code> currently does not 'cascade' from field <code>@Accessors</code> annotation to the class-level <code>@Accessors</code> annotation, but it does 'cascade' to <code>lombok.config</code>. Changing this is not difficult but backwards incompatible. It's not likely to break much existing code, but this needs to be decided on before the feature can move out of <em>experimental</em> status.</li> </ul> @@ -44,7 +45,7 @@ </li> </ul> <p><p> - The <code>@Accessors</code> annotation is legal on types and fields; the annotation that applies is the one on the field if present, otherwise the one on the class. When a <code>@Accessors</code> annotation on a field is present, any <code>@Accessors</code> annotation also present on the class the field is in, is entirely ignored, <em>even for properties not configured on the field <code>@Accessors</code></em>. This in contrast to any <code>lombok.config</code> configuration keys which serve as fall-back default if any explicit <code>@Accessors</code> annotation doesn't specify. + The <code>@Accessors</code> annotation is legal on types and fields; the annotation that applies is the one on the field if present, otherwise the one on the class. When an <code>@Accessors</code> annotation on a field is present, any <code>@Accessors</code> annotation also present on the class the field is in, is entirely ignored, <em>even for properties not configured on the field <code>@Accessors</code></em>. This in contrast to any <code>lombok.config</code> configuration keys which serve as fall-back default if any explicit <code>@Accessors</code> annotation doesn't specify. </p> </@f.overview> @@ -64,6 +65,11 @@ </dt><dd> This is a list property; entries can be added with the <code>+=</code> operator. Inherited prefixes from parent config files can be removed with the <code>-=</code> operator. Any class that either doesn't have an <code>@Accessors</code> annotation, or it does, but that annotation does not have an explicit value for the <code>prefix</code> parameter, will act as if <code>@Accessors(prefix = {<em>prefixes listed in configuration</em>})</code> is present. </dd><dt> + <code>lombok.accessors.capitalization</code> = [<code>basic</code> | <code>beanspec</code>] (default: basic) + </dt><dd> + Controls how tricky cases like <code>uShaped</code> (one lowercase letter followed by an upper/titlecase letter) are capitalized. <code>basic</code> capitalizes that to <code>getUShaped</code>, and <code>beanspec</code> capitalizes that to <code>getuShaped</code> instead.<br /> + Both strategies are commonly used in the java ecosystem, though <code>beanspec</code> is more common. + </dd><dt> <code>lombok.accessors.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) </dt><dd> Lombok will flag any usage of <code>@Accessors</code> as a warning or error if configured. diff --git a/website/templates/features/experimental/FieldNameConstants.html b/website/templates/features/experimental/FieldNameConstants.html index e88b7670..06fa23b5 100644 --- a/website/templates/features/experimental/FieldNameConstants.html +++ b/website/templates/features/experimental/FieldNameConstants.html @@ -24,7 +24,7 @@ <p> The <code>@FieldNameConstants</code> annotation generates an inner type which contains 1 constant for each field in your class; either string constants (fields marked <code>public static final</code>, of type <code>java.lang.String</code>) or if you prefer, an enum type with 1 value for each field - write <code>@FieldNameConstants(asEnum = true)</code> for the enum variant. <code>@FieldNameConstants</code> is useful for various marshalling and serialization frameworks. The constant field (whether enum value or string constant) always has the exact same name as the field, capitalization and all, unless you set the <code>lombok.fieldNameConstants.uppercase = true</code> option in your <code>lombok.config</code> file; in that case lombok will try to <code>UPPER_CASE</code> the name. </p><p> - The generated inner type is by default called <code>Fields</code> and is <code>public</code>. You can modify this via <code>@FieldNameConstants(innerTypeName = "FieldNames", access = AccessLevel.PACKAGE)</code> for example. The default inner type name can also be modified via configuration key <code>lombok.fieldNameConstants.innerTypeName</code>. The generated fields are always <code>public</code>. + The generated inner type is by default called <code>Fields</code> and is <code>public</code>. You can modify this via <code>@FieldNameConstants(innerTypeName = "FieldNames", level = AccessLevel.PACKAGE)</code> for example. The default inner type name can also be modified via configuration key <code>lombok.fieldNameConstants.innerTypeName</code>. The generated fields are always <code>public</code>. </p><p> Must be applied to classes (or enums, though you'd rarely want to do that). By default includes all non-transient, non-static fields. You can use <code>@FieldNameConstants.Include</code> in fields + <code>@FieldNameConstants(onlyExplicitlyIncluded = true)</code>, or <code>@FieldNameConstants.Exclude</code> for more fine-grained control. </p> diff --git a/website/templates/features/val.html b/website/templates/features/val.html index 32a8ffdf..1b137c65 100644 --- a/website/templates/features/val.html +++ b/website/templates/features/val.html @@ -5,6 +5,9 @@ <p> <code>val</code> was introduced in lombok 0.10. </p> + <p> + <em>NEW in Lombok 1.18.22: </em><code>val</code> gets replaced with <code>final var</code>. + </p> </@f.history> <@f.overview> <p> diff --git a/website/usageExamples/ValueExample_pre.jpage b/website/usageExamples/ValueExample_pre.jpage index d9550c25..27b28eb7 100644 --- a/website/usageExamples/ValueExample_pre.jpage +++ b/website/usageExamples/ValueExample_pre.jpage @@ -1,12 +1,12 @@ import lombok.AccessLevel; import lombok.experimental.NonFinal; import lombok.experimental.Value; -import lombok.experimental.Wither; +import lombok.experimental.With; import lombok.ToString; @Value public class ValueExample { String name; - @Wither(AccessLevel.PACKAGE) @NonFinal int age; + @With(AccessLevel.PACKAGE) @NonFinal int age; double score; protected String[] tags; |