/* * Copyright (C) 2013-2014 The Project Lombok Authors. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package lombok; import java.util.List; import lombok.core.configuration.ConfigurationKey; import lombok.core.configuration.FlagUsageType; import lombok.core.configuration.NullCheckExceptionType; /** * A container class containing all lombok configuration keys that do not belong to a specific annotation. */ public class ConfigurationKeys { private ConfigurationKeys() {} // ##### main package features ##### // ----- *ArgsConstructor ----- /** * lombok configuration: {@code lombok.anyConstructor.flagUsage} = {@code WARNING} | {@code ERROR}. * * If set, any usage of {@code @AllArgsConstructor}, {@code @RequiredArgsConstructor}, or {@code @NoArgsConstructor} results in a warning / error. */ public static final ConfigurationKey ANY_CONSTRUCTOR_FLAG_USAGE = new ConfigurationKey("lombok.anyConstructor.flagUsage", "Emit a warning or error if any of the XxxArgsConstructor annotations are used.") {}; /** * lombok configuration: {@code lombok.anyConstructor.suppressConstructorProperties} = {@code true} | {@code false}. * * If {@code false} or this configuration is omitted, all generated constructors with at least 1 argument get a {@code @ConstructorProperties}. * To suppress the generation of it, set this configuration to {@code true}. * * NB: GWT projects, and probably android projects, should explicitly set this key to {@code true} for the entire project. */ public static final ConfigurationKey ANY_CONSTRUCTOR_SUPPRESS_CONSTRUCTOR_PROPERTIES = new ConfigurationKey("lombok.anyConstructor.suppressConstructorProperties", "Suppress the generation of @ConstructorProperties for generated constructors (default: false).") {}; /** * lombok configuration: {@code lombok.allArgsConstructor.flagUsage} = {@code WARNING} | {@code ERROR}. * * If set, any usage of {@code @AllArgsConstructor} results in a warning / error. */ public static final ConfigurationKey ALL_ARGS_CONSTRUCTOR_FLAG_USAGE = new ConfigurationKey("lombok.allArgsConstructor.flagUsage", "Emit a warning or error if @AllArgsConstructor is used.") {}; /** * lombok configuration: {@code lombok.noArgsConstructor.flagUsage} = {@code WARNING} | {@code ERROR}. * * If set, any usage of {@code @NoArgsConstructor} results in a warning / error. */ public static final ConfigurationKey NO_ARGS_CONSTRUCTOR_FLAG_USAGE = new ConfigurationKey("lombok.noArgsConstructor.flagUsage", "Emit a warning or error if @NoArgsConstructor is used.") {}; /** * lombok configuration: {@code lombok.requiredArgsConstructor.flagUsage} = {@code WARNING} | {@code ERROR}. * * If set, any usage of {@code @RequiredArgsConstructor} results in a warning / error. */ public static final ConfigurationKey REQUIRED_ARGS_CONSTRUCTOR_FLAG_USAGE = new ConfigurationKey("lombok.requiredArgsConstructor.flagUsage", "Emit a warning or error if @RequiredArgsConstructor is used.") {}; // ##### Beanies ##### // ----- Data ----- /** * lombok configuration: {@code lombok.data.flagUsage} = {@code WARNING} | {@code ERROR}. * * If set, any usage of {@code @Data} results in a warning / error. */ public static final ConfigurationKey DATA_FLAG_USAGE = new ConfigurationKey("lombok.data.flagUsage", "Emit a warning or error if @Data is used.") {}; // ----- Value ----- /** * lombok configuration: {@code lombok.value.flagUsage} = {@code WARNING} | {@code ERROR}. * * If set, any usage of {@code @Value} results in a warning / error. */ public static final ConfigurationKey VALUE_FLAG_USAGE = new ConfigurationKey("lombok.value.flagUsage", "Emit a warning or error if @Value is used.") {}; // ----- Getter ----- /** * lombok configuration: {@code lombok.getter.flagUsage} = {@code WARNING} | {@code ERROR}. * * If set, any usage of {@code @Getter} results in a warning / error. */ public static final ConfigurationKey GETTER_FLAG_USAGE = new ConfigurationKey("lombok.getter.flagUsage", "Emit a warning or error if @Getter is used.") {}; /** * lombok configuration: {@code lombok.getter.lazy.flagUsage} = {@code WARNING} | {@code ERROR}. * * If set, any usage of {@code @Getter(lazy=true)} results in a warning / error. */ public static final ConfigurationKey GETTER_LAZY_FLAG_USAGE = new ConfigurationKey("lombok.getter.lazy.flagUsage", "Emit a warning or error if @Getter(lazy=true) is used.") {}; /** * lombok configuration: {@code lombok.getter.noIsPrefix} = {@code true} | {@code false}. * * If {@code true}, booleans getters are both referred to, and generated as {@code getFieldName()}. If {@code false} (the default), the javabean-standard {@code isFieldName()} is generated / used instead. * */ public static final ConfigurationKey GETTER_CONSEQUENT_BOOLEAN = new ConfigurationKey("lombok.getter.noIsPrefix", "If true, generate and use getFieldName() for boolean getters instead of isFieldName().") {}; // ----- Setter ----- /** * lombok configuration: {@code lombok.setter.flagUsage} = {@code WARNING} | {@code ERROR}. * * If set, any usage of {@code @Setter} results in a warning / error. */ public static final ConfigurationKey SETTER_FLAG_USAGE = new ConfigurationKey("lombok.setter.flagUsage", "Emit a warning or error if @Setter is used.") {}; // ----- EqualsAndHashCode ----- /** * lombok configuration: {@code lombok.equalsAndHashCode.doNotUseGetters} = {@code true} | {@code false}. * * For any class without an {@code @EqualsAndHashCode} that explicitly defines the {@code doNotUseGetters} option, this value is used. */ public static final ConfigurationKey EQUALS_AND_HASH_CODE_DO_NOT_USE_GETTERS = new ConfigurationKey("lombok.equalsAndHashCode.doNotUseGetters", "Don't call the getters but use the fields directly in the generated equalsAndHashCode method.") {}; /** * lombok configuration: {@code lombok.equalsAndHashCode.flagUsage} = {@code WARNING} | {@code ERROR}. * * If set, any usage of {@code @EqualsAndHashCode} results in a warning / error. */ public static final ConfigurationKey EQUALS_AND_HASH_CODE_FLAG_USAGE = new ConfigurationKey("lombok.equalsAndHashCode.flagUsage", "Emit a warning or error if @EqualsAndHashCode is used.") {}; // ----- ToString ----- /** * lombok configuration: {@code lombok.toString.doNotUseGetters} = {@code true} | {@code false}. * * For any class without an {@code @ToString} that explicitly defines the {@code doNotUseGetters} option, this value is used. */ public static final ConfigurationKey TO_STRING_DO_NOT_USE_GETTERS = new ConfigurationKey("lombok.toString.doNotUseGetters", "Don't call the getters but use the fields directly in the generated toString method.") {}; /** * lombok configuration: {@code lombok.toString.flagUsage} = {@code WARNING} | {@code ERROR}. * * If set, any usage of {@code @ToString} results in a warning / error. */ public static final ConfigurationKey TO_STRING_FLAG_USAGE = new ConfigurationKey("lombok.toString.flagUsage", "Emit a warning or error if @ToString is used.") {}; /** * lombok configuration: {@code lombok.toString.includeFieldNames} = {@code true} | {@code false}. * * For any class without an {@code @ToString} that explicitly defines the {@code includeFieldNames} option, this value is used. */ public static final ConfigurationKey TO_STRING_INCLUDE_FIELD_NAMES = new ConfigurationKey("lombok.toString.includeFieldNames", "Include the field names in the generated toString method.") {}; // ##### Standalones ##### // ----- Cleanup ----- /** * lombok configuration: {@code lombok.cleanup.flagUsage} = {@code WARNING} | {@code ERROR}. * * If set, any usage of {@code @Cleanup} results in a warning / error. */ public static final ConfigurationKey CLEANUP_FLAG_USAGE = new ConfigurationKey("lombok.cleanup.flagUsage", "Emit a warning or error if @Cleanup is used.") {}; // ----- Delegate ----- /** * lombok configuration: {@code lombok.delegate.flagUsage} = {@code WARNING} | {@code ERROR}. * * If set, any usage of {@code @Delegate} results in a warning / error. */ public static final ConfigurationKey DELEGATE_FLAG_USAGE = new ConfigurationKey("lombok.delegate.flagUsage", "Emit a warning or error if @Delegate is used.") {}; // ----- NonNull ----- /** * lombok configuration: {@code lombok.nonNull.exceptionType} = <String: a java exception type; either [{@code IllegalArgumentException} or: {@code NullPointerException}]. * * Sets the exception to throw if {@code @NonNull} is applied to a method parameter, and a caller passes in {@code null}. */ public static final ConfigurationKey NON_NULL_EXCEPTION_TYPE = new ConfigurationKey("lombok.nonNull.exceptionType", "The type of the exception to throw if a passed-in argument is null. Default: NullPointerException.") {}; /** * lombok configuration: {@code lombok.nonNull.flagUsage} = {@code WARNING} | {@code ERROR}. * * Implementation note: This field is supposed to be lombok.NonNull itself, but jdk6 and 7 have bugs where fields in annotations don't work well. * * If set, any usage of {@code @NonNull} results in a warning / error. */ public static final ConfigurationKey NON_NULL_FLAG_USAGE = new ConfigurationKey("lombok.nonNull.flagUsage", "Emit a warning or error if @NonNull is used.") {}; // ----- SneakyThrows ----- /** * lombok configuration: {@code lombok.sneakyThrows.flagUsage} = {@code WARNING} | {@code ERROR}. * * If set, any usage of {@code @SneakyThrows} results in a warning / error. */ public static final ConfigurationKey SNEAKY_THROWS_FLAG_USAGE = new ConfigurationKey("lombok.sneakyThrows.flagUsage", "Emit a warning or error if @SneakyThrows is used.") {}; // ----- Synchronized ----- /** * lombok configuration: {@code lombok.synchronized.flagUsage} = {@code WARNING} | {@code ERROR}. * * If set, any usage of {@code @Synchronized} results in a warning / error. */ public static final ConfigurationKey SYNCHRONIZED_FLAG_USAGE = new ConfigurationKey("lombok.synchronized.flagUsage", "Emit a warning or error if @Synchronized is used.") {}; // ----- val ----- /** * lombok configuration: {@code lombok.val.flagUsage} = {@code WARNING} | {@code ERROR}. * * If set, any usage of {@code val} results in a warning / error. */ public static final ConfigurationKey VAL_FLAG_USAGE = new ConfigurationKey("lombok.val.flagUsage", "Emit a warning or error if 'val' is used.") {}; // ##### Extern ##### // ----- Logging ----- /** * lombok configuration: {@code lombok.log.flagUsage} = {@code WARNING} | {@code ERROR}. * * If set, any usage of any of the log annotations in {@code lombok.extern}{@code @Slf4j} results in a warning / error. */ public static final ConfigurationKey LOG_ANY_FLAG_USAGE = new ConfigurationKey("lombok.log.flagUsage", "Emit a warning or error if any of the log annotations is used.") {}; /** * lombok configuration: {@code lombok.log.apacheCommons.flagUsage} = {@code WARNING} | {@code ERROR}. * * If set, any usage of {@code @CommonsLog} results in a warning / error. */ public static final ConfigurationKey LOG_COMMONS_FLAG_USAGE = new ConfigurationKey("lombok.log.apacheCommons.flagUsage", "Emit a warning or error if @CommonsLog is used.") {}; /** * lombok configuration: {@code lombok.log.javaUtilLogging.flagUsage} = {@code WARNING} | {@code ERROR}. * * If set, any usage of {@code @Log} results in a warning / error. */ public static final ConfigurationKey LOG_JUL_FLAG_USAGE = new ConfigurationKey("lombok.log.javaUtilLogging.flagUsage", "Emit a warning or error if @Log is used.") {}; /** * lombok configuration: {@code lombok.log.log4j.flagUsage} = {@code WARNING} | {@code ERROR}. * * If set, any usage of {@code @Log4j} results in a warning / error. */ public static final ConfigurationKey LOG_LOG4J_FLAG_USAGE = new ConfigurationKey("lombok.log.log4j.flagUsage", "Emit a warning or error if @Log4j is used.") {}; /** * lombok configuration: {@code lombok.log.log4j2.flagUsage} = {@code WARNING} | {@code ERROR}. * * If set, any usage of {@code @Log4j2} results in a warning / error. */ public static final ConfigurationKey LOG_LOG4J2_FLAG_USAGE = new ConfigurationKey("lombok.log.log4j2.flagUsage", "Emit a warning or error if @Log4j2 is used.") {}; /** * lombok configuration: {@code lombok.log.slf4j.flagUsage} = {@code WARNING} | {@code ERROR}. * * If set, any usage of {@code @Slf4j} results in a warning / error. */ public static final ConfigurationKey LOG_SLF4J_FLAG_USAGE = new ConfigurationKey("lombok.log.slf4j.flagUsage", "Emit a warning or error if @Slf4j is used.") {}; /** * lombok configuration: {@code lombok.log.xslf4j.flagUsage} = {@code WARNING} | {@code ERROR}. * * If set, any usage of {@code @XSlf4j} results in a warning / error. */ public static final ConfigurationKey LOG_XSLF4J_FLAG_USAGE = new ConfigurationKey("lombok.log.xslf4j.flagUsage", "Emit a warning or error if @XSlf4j is used.") {}; /** * lombok configuration: {@code lombok.log.fieldName} = <String: aJavaIdentifier> (Default: {@code log}). * * If set the various log annotations (which make a log field) will use the stated identifier instead of {@code log} as a name. */ public static final ConfigurationKey LOG_ANY_FIELD_NAME = new ConfigurationKey("lombok.log.fieldName", "Use this name for the generated logger fields (default: 'log')") {}; /** * lombok configuration: {@code lombok.log.fieldIsStatic} = {@code true} | {@code false}. * * If not set, or set to {@code true}, the log field generated by the various log annotations will be {@code static}. * * If set to {@code false}, these will be generated as instance fields instead. */ public static final ConfigurationKey LOG_ANY_FIELD_IS_STATIC = new ConfigurationKey("lombok.log.fieldIsStatic", "Make the generated logger fields static (default: true).") {}; // ##### Experimental ##### /** * lombok configuration: {@code lombok.experimental.flagUsage} = {@code WARNING} | {@code ERROR}. * * If set, any usage of any experimental features (from package {@code lombok.experimental}) that haven't been * promoted to a main feature results in a warning / error. */ public static final ConfigurationKey EXPERIMENTAL_FLAG_USAGE = new ConfigurationKey("lombok.experimental.flagUsage", "Emit a warning or error if an experimental feature is used.") {}; // ----- Accessors ----- /** * lombok configuration: {@code lombok.accessors.flagUsage} = {@code WARNING} | {@code ERROR}. * * If set, any usage of {@code @Accessors} results in a warning / error. */ public static final ConfigurationKey ACCESSORS_FLAG_USAGE = new ConfigurationKey("lombok.accessors.flagUsage", "Emit a warning or error if @Accessors is used.") {}; /** * lombok configuration: {@code lombok.accessors.prefix} += <String: prefix>. * * For any class without an {@code @Accessors} that explicitly defines the {@code prefix} option, this list of prefixes is used. */ public static final ConfigurationKey> ACCESSORS_PREFIX = new ConfigurationKey>("lombok.accessors.prefix", "Strip this field prefix, like 'f' or 'm_', from the names of generated getters and setters.") {}; /** * lombok configuration: {@code lombok.accessors.chain} = {@code true} | {@code false}. * * For any class without an {@code @Accessors} that explicitly defines the {@code chain} option, this value is used. */ public static final ConfigurationKey ACCESSORS_CHAIN = new ConfigurationKey("lombok.accessors.chain", "Generate setters that return 'this' instead of 'void'.") {}; /** * lombok configuration: {@code lombok.accessors.fluent} = {@code true} | {@code false}. * * For any class without an {@code @Accessors} that explicitly defines the {@code fluent} option, this value is used. */ public static final ConfigurationKey ACCESSORS_FLUENT = new ConfigurationKey("lombok.accessors.fluent", "Generate getters and setters using only the field name (no get/set prefix).") {}; // ----- Builder ----- /** * lombok configuration: {@code lombok.builder.flagUsage} = {@code WARNING} | {@code ERROR}. * * If set, any usage of {@code @Builder} results in a warning / error. */ public static final ConfigurationKey BUILDER_FLAG_USAGE = new ConfigurationKey("lombok.builder.flagUsage", "Emit a warning or error if @Builder is used.") {}; // ----- ExtensionMethod ----- /** * lombok configuration: {@code lombok.extensionMethod.flagUsage} = {@code WARNING} | {@code ERROR}. * * If set, any usage of {@code @ExtensionMethod} results in a warning / error. */ public static final ConfigurationKey EXTENSION_METHOD_FLAG_USAGE = new ConfigurationKey("lombok.extensionMethod.flagUsage", "Emit a warning or error if @ExtensionMethod is used.") {}; // ----- FieldDefaults ----- /** * lombok configuration: {@code lombok.fieldDefaults.flagUsage} = {@code WARNING} | {@code ERROR}. * * If set, any usage of {@code @FieldDefaults} results in a warning / error. */ public static final ConfigurationKey FIELD_DEFAULTS_FLAG_USAGE = new ConfigurationKey("lombok.fieldDefaults.flagUsage", "Emit a warning or error if @FieldDefaults is used.") {}; // ----- Wither ----- /** * lombok configuration: {@code lombok.wither.flagUsage} = {@code WARNING} | {@code ERROR}. * * If set, any usage of {@code @Wither} results in a warning / error. */ public static final ConfigurationKey WITHER_FLAG_USAGE = new ConfigurationKey("lombok.wither.flagUsage", "Emit a warning or error if @Wither is used.") {}; // ----- UtilityClass ----- /** * lombok configuration: {@code lombok.utilityClass.flagUsage} = {@code WARNING} | {@code ERROR}. * * If set, any usage of {@code @UtilityClass} results in a warning / error. */ public static final ConfigurationKey UTLITY_CLASS_FLAG_USAGE = new ConfigurationKey("lombok.utilityClass.flagUsage", "Emit a warning or error if @UtilityClass is used.") {}; // ----- Configuration System ----- /** * lombok configuration: {@code config.stopBubbling} = {@code true} | {@code false}. * * If not set, or set to {@code false}, the configuration system will look for {@code lombok.config} files in the parent directory. * * If set to {@code true}, no further {@code lombok.config} files will be checked. */ public static final ConfigurationKey STOP_BUBBLING = new ConfigurationKey("config.stopBubbling", "Tell the configuration system it should stop looking for other configuration files (default: false).") {}; }