diff options
Diffstat (limited to 'website')
-rw-r--r-- | website/templates/features/Builder.html | 9 | ||||
-rw-r--r-- | website/templates/features/Value.html | 2 | ||||
-rw-r--r-- | website/templates/features/configuration.html | 4 | ||||
-rw-r--r-- | website/templates/features/experimental/FieldNameConstants.html | 8 |
4 files changed, 18 insertions, 5 deletions
diff --git a/website/templates/features/Builder.html b/website/templates/features/Builder.html index 0818f9d2..4fe416ee 100644 --- a/website/templates/features/Builder.html +++ b/website/templates/features/Builder.html @@ -12,6 +12,8 @@ <code>@Builder.Default</code> functionality was added in lombok v1.16.16. </p><p> <code>@Builder(builderMethodName = "")</code> is legal (and will suppress generation of the builder method) starting with lombok v1.18.8. + </p><p> + <code>@Builder(access = AccessLevel.PACKAGE)</code> is legal (and will generate the builder class, the builder method, etc with the indicated access level) starting with lombok v1.18.8. </p> </@f.history> @@ -64,10 +66,12 @@ The <em>builder()</em> method's name (default: <code>"builder"</code>) </li><li> If you want <code>toBuilder()</code> (default: no) + </li><li> + The access level of all generated elements (default: <code>public</code>). </li> </ul> Example usage where all options are changed from their defaults:<br /> - <code>@Builder(builderClassName = "HelloWorldBuilder", buildMethodName = "execute", builderMethodName = "helloWorld", toBuilder = true)</code><br /> + <code>@Builder(builderClassName = "HelloWorldBuilder", buildMethodName = "execute", builderMethodName = "helloWorld", toBuilder = true, access = AccessLevel.PRIVATE)</code><br /> </p> </@f.overview> @@ -194,6 +198,9 @@ public class JacksonExample { <code>builder</code> method if you just want this functionality, by using: <code>@Builder(toBuilder = true, builderMethodName = "")</code>. </p><p> Due to a peculiar way javac processes static imports, trying to do a non-star static import of the static <code>builder()</code> method won't work. Either use a star static import: `import static TypeThatHasABuilder.*;` or don't statically import the <code>builder</code> method. + </p><p> + If setting the access level to <code>PROTECTED</code>, all methods generated inside the builder class are actually generated as <code>public</code>; the meaning of the + <code>protected</code> keyword is different inside the inner class, and the precise behaviour that <code>PROTECTED</code> would indicate (access by any source in the same package is allowed, as well as any subclasses <em>from the outer class, marked with <code>@Builder</code></em> is not possible, and marking the inner members <code>public</code> is as close as we can get. </p> </@f.smallPrint> </@f.scaffold> diff --git a/website/templates/features/Value.html b/website/templates/features/Value.html index 5fe188b3..5d97a7b8 100644 --- a/website/templates/features/Value.html +++ b/website/templates/features/Value.html @@ -17,7 +17,7 @@ </p><p> In practice, <code>@Value</code> is shorthand for: <code>final @ToString @EqualsAndHashCode @AllArgsConstructor @FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE) @Getter</code>, except that explicitly including an implementation of any of the relevant methods simply means that part won't be generated and no warning will be emitted. For example, if you write your own <code>toString</code>, no error occurs, and lombok will not generate a <code>toString</code>. Also, <em>any</em> explicit constructor, no matter the arguments list, implies lombok will not generate a constructor. If you do want lombok to generate the all-args constructor, add <code>@AllArgsConstructor</code> to the class. You can mark any constructor or method with <code>@lombok.experimental.Tolerate</code> to hide them from lombok. </p><p> - It is possible to override the final-by-default and private-by-default behavior using either an explicit access level on a field, or by using the <code>@NonFinal</code> or <code>@PackagePrivate</code> annotations.<br /> + It is possible to override the final-by-default and private-by-default behavior using either an explicit access level on a field, or by using the <code>@NonFinal</code> or <code>@PackagePrivate</code> annotations. <code>@NonFinal</code> can also be used on a class to remove the final keyword. <br /> It is possible to override any default behavior for any of the 'parts' that make up <code>@Value</code> by explicitly using that annotation. </p> </@f.overview> diff --git a/website/templates/features/configuration.html b/website/templates/features/configuration.html index 7a15f252..bf224108 100644 --- a/website/templates/features/configuration.html +++ b/website/templates/features/configuration.html @@ -30,9 +30,9 @@ </dt><dd> If set to <code>true</code>, generated setters and getters will simply be named the same as the field name, without a <code>get</code> or <code>set</code> prefix. </dd><dt> - <code>llombok.anyConstructor.addConstructorProperties</code> + <code>lombok.anyConstructor.addConstructorProperties</code> </dt><dd> - If <code>true</code>, lombok will generate a <code>@java.beans.ConstructorProperties</code> annotation when generating constructors. This is particularly useful for GWT and Android development. Note that you'll need to depend on module 'java.desktop' if you're using jigsaw. + If <code>true</code>, lombok will generate a <code>@java.beans.ConstructorProperties</code> annotation when generating constructors. Note that you'll need to depend on module 'java.desktop' if you're using jigsaw. </dd><dt> <code>lombok.log.fieldName</code> </dt><dd> diff --git a/website/templates/features/experimental/FieldNameConstants.html b/website/templates/features/experimental/FieldNameConstants.html index 1cbef32a..e88b7670 100644 --- a/website/templates/features/experimental/FieldNameConstants.html +++ b/website/templates/features/experimental/FieldNameConstants.html @@ -6,6 +6,8 @@ @FieldNameConstants was introduced as experimental feature in lombok v1.16.22. </p><p> @FieldNameConstants was redesigned in lombok v1.18.4. + </p><p> + The <em>lombok.config</em> option <code>lombok.fieldNameConstants.uppercase = true</code> was added in lombok v1.18.8. </p> </@f.history> @@ -20,7 +22,7 @@ <@f.overview> <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. + 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>. </p><p> @@ -39,6 +41,10 @@ <code>lombok.fieldNameConstants.innerTypeName</code> = <em>a string</em> (default: 'Fields') </dt><dd> The name of the inner type generated by lombok can be controlled with this configuration key. + </dd><dt> + <code>lombok.fieldNameConstants.uppercase</code> = [<code>true</code> | <code>false</code>] (default: false) + </dt><dd> + If <code>true</code>, attempt to uppercase the generated fields. </dd> </@f.confKeys> |