diff --git a/website/features/Cleanup.html b/website/features/Cleanup.html index b5adff3a..f4b16946 100644 --- a/website/features/Cleanup.html +++ b/website/features/Cleanup.html @@ -40,6 +40,13 @@
+lombok.cleanup.flagUsage = [warning | error] (default: not set)@Cleanup as a warning or error if configured.diff --git a/website/features/Constructor.html b/website/features/Constructor.html index c7e40dfb..a3163bfa 100644 --- a/website/features/Constructor.html +++ b/website/features/Constructor.html @@ -60,6 +60,17 @@
lombok.anyConstructor.suppressConstructorProperties = [true | false] (default: false)true, then lombok will skip adding a @java.beans.ConstructorProperties to generated constructors. This is useful in android and GWT development where that annotation is not usually available.lombok.[allArgsConstructor|requiredArgsConstructor|noArgsConstructor].flagUsage = [warning | error] (default: not set)@AllArgsConstructor, @RequiredArgsConstructor or @NoArgsConstructor) as a warning or error if configured.lombok.anyConstructor.flagUsage = [warning | error] (default: not set)
@@ -77,6 +88,8 @@
While suppressConstructorProperties has been marked deprecated in anticipation of a world where all java environments have the
@ConstructorProperties annotation available, first GWT 2.2 and Android 2.3.3, which do not (yet) have this annotation, will have
to be ancient history before this annotation parameter will be removed.
+
+ The flagUsage configuration keys do not trigger when a constructor is generated by @Data, @Value or any other lombok annotation.
lombok.data.flagUsage = [warning | error] (default: not set)@Data as a warning or error if configured.See the small print of @ToString, @EqualsAndHashCode,
diff --git a/website/features/EqualsAndHashCode.html b/website/features/EqualsAndHashCode.html
index f3fb8488..89d71502 100644
--- a/website/features/EqualsAndHashCode.html
+++ b/website/features/EqualsAndHashCode.html
@@ -54,6 +54,15 @@
lombok.equalsAndHashCode.doNotUseGetters = [true | false] (default: false)true, lombok will access fields directly instead of using getters (if available) when generating equals and hashCode methods. The annotation parameter 'doNotUseGetters', if explicitly specified, takes precedence over this setting.lombok.equalsAndHashCode.flagUsage = [warning | error] (default: not set)@EqualsAndHashCode as a warning or error if configured.diff --git a/website/features/GetterLazy.html b/website/features/GetterLazy.html index 3a711f58..a438f08a 100644 --- a/website/features/GetterLazy.html +++ b/website/features/GetterLazy.html @@ -30,6 +30,13 @@
@Getter's main page):lombok.getter.lazy.flagUsage = [warning | error] (default: not set)@Getter(lazy=true) as a warning or error if configured.diff --git a/website/features/GetterSetter.html b/website/features/GetterSetter.html index 76b61d80..a0da405d 100644 --- a/website/features/GetterSetter.html +++ b/website/features/GetterSetter.html @@ -46,6 +46,21 @@
lombok.accessors.chain = [true | false] (default: false)true, generated setters will return this (instead of void). An explicitly configured chain parameter of an @Accessors annotation takes precedence over this setting.lombok.accessors.fluent = [true | false] (default: false)true, generated getters and setters will not be prefixed with the bean-standard 'get, is or set; instead, the methods will use the same name as the field (minus prefixes). An explicitly configured chain parameter of an @Accessors annotation takes precedence over this setting.lombok.accessors.prefix += a field prefix (default: empty list)+= operator. Inherited prefixes from parent config files can be removed with the -= 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 m is one of the prefixes listed in this setting, then a field named mFoobar will result in a getter named getFoobar(), not getMFoobar(). An explicitly configured prefix parameter of an @Accessors annotation takes precedence over this setting.lombok.setter.flagUsage = [warning | error] (default: not set)@Setter as a warning or error if configured.lombok.getter.flagUsage = [warning | error] (default: not set)@Getter as a warning or error if configured.diff --git a/website/features/Log.html b/website/features/Log.html index c459e7ff..8b635280 100644 --- a/website/features/Log.html +++ b/website/features/Log.html @@ -49,6 +49,29 @@
lombok.log.fieldName = an identifier (default: log)log', but you can change it to a different name with this setting.lombok.log.fieldIsStatic = [true | false] (default: true)static field. By setting this key to false, the generated field will be an instance field instead.lombok.log.flagUsage = [warning | error] (default: not set)lombok.log.apacheCommons.flagUsage = [warning | error] (default: not set)@lombok.extern.apachecommons.CommonsLog as a warning or error if configured.lombok.log.javaUtilLogging.flagUsage = [warning | error] (default: not set)@lombok.extern.java.Log as a warning or error if configured.lombok.log.log4j.flagUsage = [warning | error] (default: not set)@lombok.extern.log4j.Log4j as a warning or error if configured.lombok.log.log4j2.flagUsage = [warning | error] (default: not set)@lombok.extern.log4j.Log4j2 as a warning or error if configured.lombok.log.slf4j.flagUsage = [warning | error] (default: not set)@lombok.extern.slf4j.Slf4j as a warning or error if configured.lombok.log.xslf4j.flagUsage = [warning | error] (default: not set)@lombok.extern.slf4j.XSlf4j as a warning or error if configured.@@ -59,7 +82,7 @@
lombok.nonNull.flagUsage = [warning | error] (default: not set)@NonNull as a warning or error if configured.diff --git a/website/features/SneakyThrows.html b/website/features/SneakyThrows.html index 875ee65c..e1cd6685 100644 --- a/website/features/SneakyThrows.html +++ b/website/features/SneakyThrows.html @@ -51,6 +51,13 @@
lombok.sneakyThrows.flagUsage = [warning | error] (default: not set)@SneakyThrows as a warning or error if configured.diff --git a/website/features/Synchronized.html b/website/features/Synchronized.html index c7e92aae..85c161c3 100644 --- a/website/features/Synchronized.html +++ b/website/features/Synchronized.html @@ -41,6 +41,13 @@
lombok.synchronized.flagUsage = [warning | error] (default: not set)@Synchronized as a warning or error if configured.diff --git a/website/features/ToString.html b/website/features/ToString.html index ffda89d1..6cdd8453 100644 --- a/website/features/ToString.html +++ b/website/features/ToString.html @@ -41,6 +41,17 @@
lombok.toString.includeFieldNames = [true | false] (default: true)fieldName = fieldValue. If this setting is set to false, lombok will omit the name of the field and simply deploy a comma-separated list of all the field values. The annotation parameter 'includeFieldNames', if explicitly specified, takes precedence over this setting.lombok.toString.doNotUseGetters = [true | false] (default: false)true, lombok will access fields directly instead of using getters (if available) when generating toString methods. The annotation parameter 'doNotUseGetters', if explicitly specified, takes precedence over this setting.lombok.toString.flagUsage = [warning | error] (default: not set)@ToString as a warning or error if configured.diff --git a/website/features/Value.html b/website/features/Value.html index 07e1e949..09557c6a 100644 --- a/website/features/Value.html +++ b/website/features/Value.html @@ -45,6 +45,13 @@
lombok.value.flagUsage = [warning | error] (default: not set)@Value as a warning or error if configured.diff --git a/website/features/configuration.html b/website/features/configuration.html new file mode 100644 index 00000000..acf874e7 --- /dev/null +++ b/website/features/configuration.html @@ -0,0 +1,91 @@ + +
+ + + + + +
+ NEW in lombok 1.14: You can create lombok.config files in any directory and put configuration directives in it. These apply to all source files in this directory and all child directories.
+ The configuration system is particularly useful for configurable aspects of lombok which tend to be the same across an entire project, such as the name of your log variable. The configuration system can also be used to tell lombok to flag any usage of some lombok feature you don't like as a warning or even an error.
+
+ Usually, a user of lombok puts a lombok.config file with their preferences in a workspace or project root directory, with the special config.stopBubbling = true key to tell lombok this is your root directory. You can then create lombok.config files in any subdirectories (generally representing projects or source packages) with different settings.
+
+ An up to date list of all configuration keys supported by your version of lombok can be generated by running: +
java -jar lombok.jar config -g --verboselombok.config file.
+ A sample of available configuration options (see the feature pages of the lombok features for their related config keys, as well as java -jar lombok.jar config -g for the complete list):
+
lombok.accessors.chaintrue, generated setters will 'chain' by default (They will return this instead of having a void return type).lombok.accessors.fluenttrue, generated setters and getters will simply be named the same as the field name, without a get or set prefix.lombok.anyConstructor.suppressConstructorPropertiestrue, lombok will not generate a @java.beans.ConstructorProperties annotation when generating constructors. This is particularly useful for GWT and Android development.lombok.log.fieldNamelog).lombok.(featureName).flagUsagewarning or error. Some examples of values for (featureName) are: "experimental" (flags use of any of the experimental features), "builder", "sneakyThrows", or "extensionMethod".
+ Configuration files are hierarchical: Any configuration setting applies to all source files in that directory, and all source files in subdirectories, but configuration settings closer to the source file take precedence. For example, if you have in /Users/me/projects/lombok.config the following:
+
lombok.log.fieldName = foobar
+ /Users/me/projects/MyProject/lombok.config you have:
+ lombok.log.fieldName = xyzzy
+ @Log annotations will use foobar instead of the default log as a field name to generate in all your projects,
+ except for your project in /Users/me/projects/MyProject, where xyzzy is used instead.
+
+ To restore a configuration key set by a parent config file back to the default, the clear option can be used. For example, if a parent configuration file has configured all use of val to emit a warning, you can turn off the warnings for a subdirectory by including in it a lombok.config file with:
+
clear lombok.val.flagUsage
+
+ Some configuration keys take lists. For lists, use += to add an entry. You can remove a single item from the list (useful to undo a parent configuration file's setting) with -=. For example:
+
lombok.accessors.prefix += m_
+ + To stop lombok from looking at parent directories for more configuration files, the special key: +
config.stopBubbling = true
+
+ Comments can be included in lombok.config files; any line that starts with # is considered a comment.
+
lombok.accessors.chain = [true | false] (default: false)true, any class that either doesn't have an @Accessors annotation, or it does, but that annotation does not have an explicit value for the chain parameter, will act as if @Accessors(chain = true) is present.lombok.accessors.fluent = [true | false] (default: false)true, any class that either doesn't have an @Accessors annotation, or it does, but that annotation does not have an explicit value for the fluent parameter, will act as if @Accessors(fluent = true) is present.lombok.accessors.prefix += a field prefix (default: empty list)+= operator. Inherited prefixes from parent config files can be removed with the -= operator. Any class that either doesn't have an @Accessors annotation, or it does, but that annotation does not have an explicit value for the prefix parameter, will act as if @Accessors(prefix = {prefixes listed in configuration}) is present.lombok.accessors.flagUsage = [warning | error] (default: not set)@Accessors as a warning or error if configured.diff --git a/website/features/experimental/Builder.html b/website/features/experimental/Builder.html index 84452299..a8e21b9a 100644 --- a/website/features/experimental/Builder.html +++ b/website/features/experimental/Builder.html @@ -91,6 +91,13 @@
lombok.builder.flagUsage = [warning | error] (default: not set)@Builder as a warning or error if configured.diff --git a/website/features/experimental/Delegate.html b/website/features/experimental/Delegate.html index 41a36d82..bd4fc393 100644 --- a/website/features/experimental/Delegate.html +++ b/website/features/experimental/Delegate.html @@ -59,6 +59,13 @@
lombok.delegate.flagUsage = [warning | error] (default: not set)@Delegate as a warning or error if configured.diff --git a/website/features/experimental/ExtensionMethod.html b/website/features/experimental/ExtensionMethod.html index b2c751b9..58aaf1b3 100644 --- a/website/features/experimental/ExtensionMethod.html +++ b/website/features/experimental/ExtensionMethod.html @@ -77,6 +77,13 @@ System.out.println(x.or("Hello, World!"));
lombok.extensionMethod.flagUsage = [warning | error] (default: not set)@ExtensionMethod as a warning or error if configured.diff --git a/website/features/experimental/FieldDefaults.html b/website/features/experimental/FieldDefaults.html index 159938a5..12ea7d80 100644 --- a/website/features/experimental/FieldDefaults.html +++ b/website/features/experimental/FieldDefaults.html @@ -56,6 +56,13 @@
lombok.fieldDefaults.flagUsage = [warning | error] (default: not set)@FieldDefaults as a warning or error if configured.diff --git a/website/features/experimental/Wither.html b/website/features/experimental/Wither.html index 12475f6e..9ca43a46 100644 --- a/website/features/experimental/Wither.html +++ b/website/features/experimental/Wither.html @@ -62,6 +62,13 @@
lombok.wither.flagUsage = [warning | error] (default: not set)@Wither as a warning or error if configured.diff --git a/website/features/experimental/index.html b/website/features/experimental/index.html index 2c641228..f37712e0 100644 --- a/website/features/experimental/index.html +++ b/website/features/experimental/index.html @@ -38,6 +38,13 @@
lombok.experimental.flagUsage = [warning | error] (default: not set)@Loglombok.val.flagUsage = [warning | error] (default: not set)val as a warning or error if configured.