Enum Class JacksonOption
- All Implemented Interfaces:
Serializable,Comparable<JacksonOption>,Constable
Flags to enable/disable certain aspects of the
JacksonSchemaModule's processing.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionUse this option to ensure all looked-up subtypes according to@JsonSubTypesannotations are referenced via the central "$defs".Use this option to treat enum types with aJsonPropertyannotation on each of its constants as plain strings in the generated schema.Use this option to treat enum types with aJsonValueannotation on one of its methods as plain strings in the generated schema.Use this option to skip property name changes according toJsonNamingannotations.Use this option to skip the transformation according to@JsonTypeInfoannotations (typically used to identify specific subtypes).Use this option to ignore all methods that don't have aJsonPropertyannotation themselves or in case of getter methods on their associated field.Use this option to ensure all looked-up subtypes according to@JsonSubTypesannotations are referenced via the central "$defs".Use this option to consider@JsonIdentityReference(alwaysAsId = true)annotations on fields/methods or the type itself.Use this option to sort an object's properties according to associatedJsonPropertyOrderannotations.Use this option to include fields annotated with@JsonProperty(required = true)in the containing type's list of "required" properties.Use this option to skip the automatic look-up of subtypes according to@JsonSubTypesannotations. -
Method Summary
Modifier and TypeMethodDescriptionstatic JacksonOptionReturns the enum constant of this class with the specified name.static JacksonOption[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
FLATTENED_ENUMS_FROM_JSONVALUE
Use this option to treat enum types with aJsonValueannotation on one of its methods as plain strings in the generated schema. If no such annotation withvalue = trueis present on exactly one argument-free method, it will fall-back on following custom definitions (e.g. from one of the standard generatorOptions).
This can be enabled at the same time as theFLATTENED_ENUMS_FROM_JSONPROPERTYoption, with theJsonValueannotation taking precedence.- See Also:
-
FLATTENED_ENUMS_FROM_JSONPROPERTYOption.FLATTENED_ENUMSOption.FLATTENED_ENUMS_FROM_TOSTRING
-
FLATTENED_ENUMS_FROM_JSONPROPERTY
Use this option to treat enum types with aJsonPropertyannotation on each of its constants as plain strings in the generated schema. If no such annotation is present on each enum constants, it will fall-back on following custom definitions (e.g. from one of the standard generatorOptions).
This can be enabled at the same time as theFLATTENED_ENUMS_FROM_JSONVALUEoption, with theJsonValueannotation taking precedence.- See Also:
-
FLATTENED_ENUMS_FROM_JSONVALUEOption.FLATTENED_ENUMSOption.FLATTENED_ENUMS_FROM_TOSTRING
-
RESPECT_JSONPROPERTY_ORDER
Use this option to sort an object's properties according to associatedJsonPropertyOrderannotations. Fields and methods without such an annotation are listed after annotated properties. -
INCLUDE_ONLY_JSONPROPERTY_ANNOTATED_METHODS
Use this option to ignore all methods that don't have aJsonPropertyannotation themselves or in case of getter methods on their associated field. When including non-getter methods with annotated property names, you'll probably want to enable the generalOption.FIELDS_DERIVED_FROM_ARGUMENTFREE_METHODSas well, in order to avoid parentheses at the end.- Since:
- 4.21.0
- See Also:
-
Option.FIELDS_DERIVED_FROM_ARGUMENTFREE_METHODS
-
IGNORE_PROPERTY_NAMING_STRATEGY
Use this option to skip property name changes according toJsonNamingannotations. -
ALWAYS_REF_SUBTYPES
Use this option to ensure all looked-up subtypes according to@JsonSubTypesannotations are referenced via the central "$defs". This applies to the wrapping schema produced based on@JsonTypeInfoannotations, e.g., with wrapping object/array or additional property.- Since:
- 4.27.0
-
INLINE_TRANSFORMED_SUBTYPES
Use this option to ensure all looked-up subtypes according to@JsonSubTypesannotations are referenced via the central "$defs". This applies to the nested schema inside the wrapping object/array or "allOf" based on@JsonTypeInfoannotations. This can be used to counter-act theOption.DEFINITIONS_FOR_ALL_OBJECTS. Beware: as with every explicit inlining, recursive non-transformed references can result in a stack overflow during schema generation when this option is enabled (similar toOption.INLINE_ALL_SCHEMAS)!- Since:
- 4.30.0
-
SKIP_SUBTYPE_LOOKUP
Use this option to skip the automatic look-up of subtypes according to@JsonSubTypesannotations. -
IGNORE_TYPE_INFO_TRANSFORM
Use this option to skip the transformation according to@JsonTypeInfoannotations (typically used to identify specific subtypes). -
RESPECT_JSONPROPERTY_REQUIRED
Use this option to include fields annotated with@JsonProperty(required = true)in the containing type's list of "required" properties.- Since:
- 4.18.0
-
JSONIDENTITY_REFERENCE_ALWAYS_AS_ID
Use this option to consider@JsonIdentityReference(alwaysAsId = true)annotations on fields/methods or the type itself.- Since:
- 4.28.0
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-