Top Description Fields Constructors Methods
com.fasterxml.jackson.databind

public final Enum MapperFeature

extends Enum<MapperFeature>
implements ConfigFeature
Class Inheritance
All Implemented Interfaces
com.fasterxml.jackson.databind.cfg.ConfigFeature
Imports
com.fasterxml.jackson.databind.annotation.JsonSerialize, com.fasterxml.jackson.databind.cfg.ConfigFeature

Enumeration that defines simple on/off features to set for ObjectMapper, and accessible (but not changeable) via ObjectReader and ObjectWriter (as well as through various convenience methods through context objects).

Note that in addition to being only mutable via ObjectMapper, changes only take effect when done before any serialization or deserialization calls -- that is, caller must follow "configure-then-use" pattern.

Field Summary

Modifier and TypeField and Description
private final boolean
private final long
public static final MapperFeature
ACCEPT_CASE_INSENSITIVE_ENUMS

Feature that determines if Enum deserialization should be case sensitive or not.

public static final MapperFeature
ACCEPT_CASE_INSENSITIVE_PROPERTIES

Feature that will allow for more forgiving deserialization of incoming JSON.

public static final MapperFeature
ACCEPT_CASE_INSENSITIVE_VALUES

Feature that permits parsing some enumerated text-based value types but ignoring the case of the values on deserialization: for example, date/time type deserializers.

public static final MapperFeature
ALLOW_COERCION_OF_SCALARS

Feature that determines whether coercions from secondary representations are allowed for simple non-textual scalar types: numbers and booleans.

public static final MapperFeature
ALLOW_EXPLICIT_PROPERTY_RENAMING

Feature that when enabled will allow explicitly named properties (i.e., fields or methods annotated with com.fasterxml.jackson.annotation.JsonProperty("explicitName")) to be re-named by a PropertyNamingStrategy, if one is configured.

public static final MapperFeature
ALLOW_FINAL_FIELDS_AS_MUTATORS

Feature that determines whether member fields declared as 'final' may be auto-detected to be used mutators (used to change value of the logical property) or not.

public static final MapperFeature
ALLOW_IS_GETTERS_FOR_NON_BOOLEAN

Feature that when enabled will allow getters with is-Prefix also for non-boolean return types; if disabled only methods that return boolean or Boolean qualify as "is getters".

public static final MapperFeature
ALLOW_VOID_VALUED_PROPERTIES

Feature that determines whether nominal property type of Void is allowed for Getter methods to indicate null valued pseudo-property or not.

public static final MapperFeature
APPLY_DEFAULT_VALUES

Feature that determines whether ObjectReader applies default values defined in class definitions in cases where the input data omits the relevant values.

public static final MapperFeature
AUTO_DETECT_CREATORS

Feature that determines whether "creator" methods are automatically detected by consider public constructors, and static single argument methods with name "valueOf".

public static final MapperFeature
AUTO_DETECT_FIELDS

Feature that determines whether non-static fields are recognized as properties.

public static final MapperFeature
AUTO_DETECT_GETTERS

Feature that determines whether regular "getter" methods are automatically detected based on standard Bean naming convention or not.

public static final MapperFeature
AUTO_DETECT_IS_GETTERS

Feature that determines whether "is getter" methods are automatically detected based on standard Bean naming convention or not.

public static final MapperFeature
AUTO_DETECT_SETTERS

Feature that determines whether "setter" methods are automatically detected based on standard Bean naming convention or not.

public static final MapperFeature
BLOCK_UNSAFE_POLYMORPHIC_BASE_TYPES

Setting that may be enabled to reconfigure default com.fasterxml.jackson.databind.jsontype.PolymorphicTypeValidator used by legacy ObjectMapper.enableDefaultTyping() methods as well as default used for annotation-based polymorphic handling so that it uses com.fasterxml.jackson.databind.jsontype.DefaultBaseTypeLimitingValidator.

public static final MapperFeature
CAN_OVERRIDE_ACCESS_MODIFIERS

Feature that determines whether method and field access modifier settings can be overridden when accessing properties.

public static final MapperFeature
DEFAULT_VIEW_INCLUSION

Feature that determines whether properties that have no view annotations are included in JSON serialization views (see com.fasterxml.jackson.annotation.JsonView for more details on JSON Views).

public static final MapperFeature
IGNORE_DUPLICATE_MODULE_REGISTRATIONS

Feature that determines whether multiple registrations of same module should be ignored or not; if enabled, only the first registration call results in module being called, and possible duplicate calls are silently ignored; if disabled, no checking is done and all registration calls are dispatched to module.

public static final MapperFeature
IGNORE_MERGE_FOR_UNMERGEABLE

Setting that determines what happens if an attempt is made to explicitly "merge" value of a property, where value does not support merging; either merging is skipped and new value is created (true) or an exception is thrown (false).

public static final MapperFeature
INFER_BUILDER_TYPE_BINDINGS

Feature that enables inferring builder type bindings from the value type being deserialized.

public static final MapperFeature
INFER_CREATOR_FROM_CONSTRUCTOR_PROPERTIES

Feature that determines handling of java.beans.ConstructorProperties annotation: when enabled, it is considered as alias of com.fasterxml.jackson.annotation.JsonCreator, to mean that constructor should be considered a property-based Creator; when disabled, only constructor parameter name information is used, but constructor is NOT considered an explicit Creator (although may be discovered as one using other annotations or heuristics).

public static final MapperFeature
INFER_PROPERTY_MUTATORS

Feature that determines whether member mutators (fields and setters) may be "pulled in" even if they are not visible, as long as there is a visible accessor (getter or field) with same name.

public static final MapperFeature
OVERRIDE_PUBLIC_ACCESS_MODIFIERS

Feature that determines that forces call to java.lang.reflect.AccessibleObject#setAccessible even for public accessors -- that is, even if no such call is needed from functionality perspective -- if call is allowed (that is, CAN_OVERRIDE_ACCESS_MODIFIERS is set to true).

public static final MapperFeature
PROPAGATE_TRANSIENT_MARKER

Feature that determines how transient modifier for fields is handled: if disabled, it is only taken to mean exclusion of the field as an accessor; if true, it is taken to imply removal of the whole property.

public static final MapperFeature
REQUIRE_SETTERS_FOR_GETTERS

Feature that determines whether getters (getter methods) can be auto-detected if there is no matching mutator (setter, constructor parameter or field) or not: if set to true, only getters that match a mutator are auto-discovered; if false, all auto-detectable getters can be discovered.

public static final MapperFeature
REQUIRE_TYPE_ID_FOR_SUBTYPES

Feature that determines what happens when deserializing to a registered sub-type (polymorphic deserialization), but no type information has been provided.

public static final MapperFeature
SORT_CREATOR_PROPERTIES_BY_DECLARATION_ORDER

Feature that defines whether Creator properties (ones passed through constructor or static factory method) should be sorted in their declaration order if SORT_CREATOR_PROPERTIES_FIRST is also enabled.

public static final MapperFeature
SORT_CREATOR_PROPERTIES_FIRST

Feature that defines whether Creator properties (ones passed through constructor or static factory method) should be sorted before other properties for which no explicit order is specified, in case where alphabetic ordering is to be used for such properties.

public static final MapperFeature
SORT_PROPERTIES_ALPHABETICALLY

Feature that defines default property serialization order used for POJO properties.

public static final MapperFeature
USE_ANNOTATIONS

Feature that determines whether annotation introspection is used for configuration; if enabled, configured AnnotationIntrospector will be used: if disabled, no annotations are considered.

public static final MapperFeature
USE_BASE_TYPE_AS_DEFAULT_IMPL

Feature that specifies whether the declared base type of a polymorphic value is to be used as the "default" implementation, if no explicit default class is specified via @JsonTypeInfo.defaultImpl annotation.

public static final MapperFeature
USE_GETTERS_AS_SETTERS

Feature that determines whether otherwise regular "getter" methods (but only ones that handle Collections and Maps, not getters of other type) can be used for purpose of getting a reference to a Collection and Map to modify the property, without requiring a setter method.

public static final MapperFeature
USE_STATIC_TYPING

Feature that determines whether the type detection for serialization should be using actual dynamic runtime type, or declared static type.

public static final MapperFeature
USE_STD_BEAN_NAMING

Feature that may be enabled to enforce strict compatibility with Bean name introspection, instead of slightly different mechanism Jackson defaults to.

public static final MapperFeature
USE_WRAPPER_NAME_AS_PROPERTY_NAME

Feature that can be enabled to make property names be overridden by wrapper name (usually detected with annotations as defined by AnnotationIntrospector#findWrapperName.

Constructor Summary

AccessConstructor and Description
private
MapperFeature(boolean defaultState)

Method Summary

Modifier and TypeMethod and Description
public static long
public boolean
enabledByDefault()

Implements com.fasterxml.jackson.databind.cfg.ConfigFeature.enabledByDefault.

Accessor for checking whether this feature is enabled by default.

public boolean
enabledIn(int flags)

Implements com.fasterxml.jackson.databind.cfg.ConfigFeature.enabledIn.

Deprecated

Convenience method for checking whether feature is enabled in given bitmask

public boolean
enabledIn(long flags)

public long
public int
getMask()

Implements com.fasterxml.jackson.databind.cfg.ConfigFeature.getMask.

Deprecated

Returns bit mask for this feature instance

public static MapperFeature
public static MapperFeature[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

_defaultStateback to summary
private final boolean _defaultState
_maskback to summary
private final long _mask
ACCEPT_CASE_INSENSITIVE_ENUMSback to summary
public static final MapperFeature ACCEPT_CASE_INSENSITIVE_ENUMS

Feature that determines if Enum deserialization should be case sensitive or not. If enabled, Enum deserialization will ignore case, that is, case of incoming String value and enum id (depending on other settings, either `name()`, `toString()`, or explicit override) do not need to match.

This should allow both Enum-as-value deserialization and Enum-as-Map-key, but latter only works since Jackson 2.12 (due to incomplete implementation).

Feature is disabled by default.

Since
2.9
ACCEPT_CASE_INSENSITIVE_PROPERTIESback to summary
public static final MapperFeature ACCEPT_CASE_INSENSITIVE_PROPERTIES

Feature that will allow for more forgiving deserialization of incoming JSON. If enabled, the bean properties will be matched using their lower-case equivalents, meaning that any case-combination (incoming and matching names are canonicalized by lower-casing) should work.

Note that there is additional performance overhead since incoming property names need to be lower-cased before comparison, for cases where there are upper-case letters. Overhead for names that are already lower-case should be negligible.

Feature is disabled by default.

Since
2.5
ACCEPT_CASE_INSENSITIVE_VALUESback to summary
public static final MapperFeature ACCEPT_CASE_INSENSITIVE_VALUES

Feature that permits parsing some enumerated text-based value types but ignoring the case of the values on deserialization: for example, date/time type deserializers. Support for this feature depends on deserializer implementations using it.

Note, however, that regular Enum types follow ACCEPT_CASE_INSENSITIVE_ENUMS setting instead.

Feature is disabled by default.

Since
2.10
ALLOW_COERCION_OF_SCALARSback to summary
public static final MapperFeature ALLOW_COERCION_OF_SCALARS

Feature that determines whether coercions from secondary representations are allowed for simple non-textual scalar types: numbers and booleans. This includes `primitive` types and their wrappers, but excludes `java.lang.String` and date/time types.

When feature is disabled, only strictly compatible input may be bound: numbers for numbers, boolean values for booleans. When feature is enabled, conversions from JSON String are allowed, as long as textual value matches (for example, String "true" is allowed as equivalent of JSON boolean token `true`; or String "1.0" for `double`).

Note that it is possible that other configurability options can override this in closer scope (like on per-type or per-property basis); this is just the global default.

Feature is enabled by default (for backwards compatibility since this was the default behavior)

Since
2.9
ALLOW_EXPLICIT_PROPERTY_RENAMINGback to summary
public static final MapperFeature ALLOW_EXPLICIT_PROPERTY_RENAMING

Feature that when enabled will allow explicitly named properties (i.e., fields or methods annotated with com.fasterxml.jackson.annotation.JsonProperty("explicitName")) to be re-named by a PropertyNamingStrategy, if one is configured.

Feature is disabled by default.

Since
2.7
ALLOW_FINAL_FIELDS_AS_MUTATORSback to summary
public static final MapperFeature ALLOW_FINAL_FIELDS_AS_MUTATORS

Feature that determines whether member fields declared as 'final' may be auto-detected to be used mutators (used to change value of the logical property) or not. If enabled, 'final' access modifier has no effect, and such fields may be detected according to usual visibility and inference rules; if disabled, such fields are NOT used as mutators except if explicitly annotated for such use.

Feature is enabled by default, for backwards compatibility reasons.

Since
2.2
ALLOW_IS_GETTERS_FOR_NON_BOOLEANback to summary
public static final MapperFeature ALLOW_IS_GETTERS_FOR_NON_BOOLEAN

Feature that when enabled will allow getters with is-Prefix also for non-boolean return types; if disabled only methods that return boolean or Boolean qualify as "is getters".

Feature is disabled by default for backwards compatibility.

Since
2.14
ALLOW_VOID_VALUED_PROPERTIESback to summary
public static final MapperFeature ALLOW_VOID_VALUED_PROPERTIES

Feature that determines whether nominal property type of Void is allowed for Getter methods to indicate null valued pseudo-property or not. If enabled, such properties are recognized (see [databind#2675] for reasons -- mostly things related to frameworks, code generation); if disabled, such property accessors (or at least getters) are ignored.

Feature is disabled by default (in 2.12) for backwards compatibility.

Since
2.12
APPLY_DEFAULT_VALUESback to summary
public static final MapperFeature APPLY_DEFAULT_VALUES

Feature that determines whether ObjectReader applies default values defined in class definitions in cases where the input data omits the relevant values.

Not all modules will respect this feature. Initially, only jackson-module-scala will respect this feature but other modules will add support over time.

Feature is enabled by default.

Since
2.13
AUTO_DETECT_CREATORSback to summary
public static final MapperFeature AUTO_DETECT_CREATORS

Feature that determines whether "creator" methods are automatically detected by consider public constructors, and static single argument methods with name "valueOf". If disabled, only methods explicitly annotated are considered creator methods (except for the no-arg default constructor which is always considered a factory method).

Note that this feature has lower precedence than per-class annotations, and is only used if there isn't more granular configuration available.

Feature is enabled by default.

AUTO_DETECT_FIELDSback to summary
public static final MapperFeature AUTO_DETECT_FIELDS

Feature that determines whether non-static fields are recognized as properties. If yes, then all public member fields are considered as properties. If disabled, only fields explicitly annotated are considered property fields.

Note that this feature has lower precedence than per-class annotations, and is only used if there isn't more granular configuration available.

Feature is enabled by default.

AUTO_DETECT_GETTERSback to summary
public static final MapperFeature AUTO_DETECT_GETTERS

Feature that determines whether regular "getter" methods are automatically detected based on standard Bean naming convention or not. If yes, then all public zero-argument methods that start with prefix "get" are considered as getters. If disabled, only methods explicitly annotated are considered getters.

Note that since version 1.3, this does NOT include "is getters" (see AUTO_DETECT_IS_GETTERS for details)

Note that this feature has lower precedence than per-class annotations, and is only used if there isn't more granular configuration available.

Feature is enabled by default.

AUTO_DETECT_IS_GETTERSback to summary
public static final MapperFeature AUTO_DETECT_IS_GETTERS

Feature that determines whether "is getter" methods are automatically detected based on standard Bean naming convention or not. If yes, then all public zero-argument methods that start with prefix "is", and whose return type is boolean are considered as "is getters". If disabled, only methods explicitly annotated are considered getters.

Note that this feature has lower precedence than per-class annotations, and is only used if there isn't more granular configuration available.

Feature is enabled by default.

AUTO_DETECT_SETTERSback to summary
public static final MapperFeature AUTO_DETECT_SETTERS

Feature that determines whether "setter" methods are automatically detected based on standard Bean naming convention or not. If yes, then all public one-argument methods that start with prefix "set" are considered setters. If disabled, only methods explicitly annotated are considered setters.

Note that this feature has lower precedence than per-class annotations, and is only used if there isn't more granular configuration available.

Feature is enabled by default.

BLOCK_UNSAFE_POLYMORPHIC_BASE_TYPESback to summary
public static final MapperFeature BLOCK_UNSAFE_POLYMORPHIC_BASE_TYPES

Setting that may be enabled to reconfigure default com.fasterxml.jackson.databind.jsontype.PolymorphicTypeValidator used by legacy ObjectMapper.enableDefaultTyping() methods as well as default used for annotation-based polymorphic handling so that it uses com.fasterxml.jackson.databind.jsontype.DefaultBaseTypeLimitingValidator. This will block use of a set of "unsafe" base types such as java.lang.Object through methods that do not require passing of explicit com.fasterxml.jackson.databind.jsontype.PolymorphicTypeValidator. It is still possible to override one used; this only affects default settings.

Enabling of this setting is strongly recommended.

Feature is disabled by default in 2.x for backwards compatibility reasons: it will become default setting (and feature likely removed) in 3.0.

Since
2.11
CAN_OVERRIDE_ACCESS_MODIFIERSback to summary
public static final MapperFeature CAN_OVERRIDE_ACCESS_MODIFIERS

Feature that determines whether method and field access modifier settings can be overridden when accessing properties. If enabled, method java.lang.reflect.AccessibleObject#setAccessible may be called to enable access to otherwise unaccessible objects.

Note that this setting may have significant performance implications, since access override helps remove costly access checks on each and every Reflection access. If you are considering disabling this feature, be sure to verify performance consequences if usage is performance sensitive. Also note that performance effects vary between Java platforms (JavaSE vs Android, for example), as well as JDK versions: older versions seemed to have more significant performance difference.

Conversely, on some platforms, it may be necessary to disable this feature as platform does not allow such calls. For example, when developing Applets (or other Java code that runs on tightly restricted sandbox), it may be necessary to disable the feature regardless of performance effects.

Feature is enabled by default.

DEFAULT_VIEW_INCLUSIONback to summary
public static final MapperFeature DEFAULT_VIEW_INCLUSION

Feature that determines whether properties that have no view annotations are included in JSON serialization views (see com.fasterxml.jackson.annotation.JsonView for more details on JSON Views). If enabled, non-annotated properties will be included; when disabled, they will be excluded. So this feature changes between "opt-in" (feature disabled) and "opt-out" (feature enabled) modes.

Default value is enabled, meaning that non-annotated properties are included in all views if there is no com.fasterxml.jackson.annotation.JsonView annotation.

Feature is enabled by default.

IGNORE_DUPLICATE_MODULE_REGISTRATIONSback to summary
public static final MapperFeature IGNORE_DUPLICATE_MODULE_REGISTRATIONS

Feature that determines whether multiple registrations of same module should be ignored or not; if enabled, only the first registration call results in module being called, and possible duplicate calls are silently ignored; if disabled, no checking is done and all registration calls are dispatched to module.

Definition of "same module" is based on using Module#getTypeId(); modules with same non-null type id are considered same for purposes of duplicate registration. This also avoids having to keep track of actual module instances; only ids will be kept track of (and only if this feature is enabled).

Feature is enabled by default.

Since
2.5
IGNORE_MERGE_FOR_UNMERGEABLEback to summary
public static final MapperFeature IGNORE_MERGE_FOR_UNMERGEABLE

Setting that determines what happens if an attempt is made to explicitly "merge" value of a property, where value does not support merging; either merging is skipped and new value is created (true) or an exception is thrown (false).

Feature is enabled by default, to allow use of merge defaults even in presence of some unmergeable properties.

Since
2.9
INFER_BUILDER_TYPE_BINDINGSback to summary
public static final MapperFeature INFER_BUILDER_TYPE_BINDINGS

Feature that enables inferring builder type bindings from the value type being deserialized. This requires that the generic type declaration on the value type match that on the builder exactly: mismatched type declarations are not necessarily detected by databind.

Feature is enabled by default which means that deserialization does support deserializing types via builders with type parameters (generic types).

See: databind#921

Since
2.12
INFER_CREATOR_FROM_CONSTRUCTOR_PROPERTIESback to summary
public static final MapperFeature INFER_CREATOR_FROM_CONSTRUCTOR_PROPERTIES

Feature that determines handling of java.beans.ConstructorProperties annotation: when enabled, it is considered as alias of com.fasterxml.jackson.annotation.JsonCreator, to mean that constructor should be considered a property-based Creator; when disabled, only constructor parameter name information is used, but constructor is NOT considered an explicit Creator (although may be discovered as one using other annotations or heuristics).

Feature is mostly used to help inter-operability with frameworks like Lombok that may automatically generate ConstructorProperties annotation but without necessarily meaning that constructor should be used as Creator for deserialization.

Feature is enabled by default.

Since
2.9
INFER_PROPERTY_MUTATORSback to summary
public static final MapperFeature INFER_PROPERTY_MUTATORS

Feature that determines whether member mutators (fields and setters) may be "pulled in" even if they are not visible, as long as there is a visible accessor (getter or field) with same name. For example: field "value" may be inferred as mutator, if there is visible or explicitly marked getter "getValue()". If enabled, inferring is enabled; otherwise (disabled) only visible and explicitly annotated accessors are ever used.

Note that 'getters' are never inferred and need to be either visible (including bean-style naming) or explicitly annotated.

Feature is enabled by default.

Since
2.2
OVERRIDE_PUBLIC_ACCESS_MODIFIERSback to summary
public static final MapperFeature OVERRIDE_PUBLIC_ACCESS_MODIFIERS

Feature that determines that forces call to java.lang.reflect.AccessibleObject#setAccessible even for public accessors -- that is, even if no such call is needed from functionality perspective -- if call is allowed (that is, CAN_OVERRIDE_ACCESS_MODIFIERS is set to true). The main reason to enable this feature is possible performance improvement as JDK does not have to perform access checks; these checks are otherwise made for all accessors, including public ones, and may result in slower Reflection calls. Exact impact (if any) depends on Java platform (Java SE, Android) as well as JDK version.

Feature is enabled by default, for legacy reasons (it was the behavior until 2.6)

Since
2.7
PROPAGATE_TRANSIENT_MARKERback to summary
public static final MapperFeature PROPAGATE_TRANSIENT_MARKER

Feature that determines how transient modifier for fields is handled: if disabled, it is only taken to mean exclusion of the field as an accessor; if true, it is taken to imply removal of the whole property.

Feature is disabled by default, meaning that existence of `transient` for a field does not necessarily lead to ignoral of getters or setters but just ignoring the use of field for access.

Note

This should have no effect on explicit ignoral annotation possibly added to transient fields: those should always have expected semantics (same as if field was not transient).

Since
2.6
REQUIRE_SETTERS_FOR_GETTERSback to summary
public static final MapperFeature REQUIRE_SETTERS_FOR_GETTERS

Feature that determines whether getters (getter methods) can be auto-detected if there is no matching mutator (setter, constructor parameter or field) or not: if set to true, only getters that match a mutator are auto-discovered; if false, all auto-detectable getters can be discovered.

Feature is disabled by default.

REQUIRE_TYPE_ID_FOR_SUBTYPESback to summary
public static final MapperFeature REQUIRE_TYPE_ID_FOR_SUBTYPES

Feature that determines what happens when deserializing to a registered sub-type (polymorphic deserialization), but no type information has been provided. If enabled, then an InvalidTypeIdException will be thrown; if disabled then the deserialization may proceed without the type information if sub-type is legit target (non-abstract).

Feature is enabled by default for backwards-compatibility (same behavior as in Jackson 2.14 and earlier).

Since
2.15
SORT_CREATOR_PROPERTIES_BY_DECLARATION_ORDERback to summary
public static final MapperFeature SORT_CREATOR_PROPERTIES_BY_DECLARATION_ORDER

Feature that defines whether Creator properties (ones passed through constructor or static factory method) should be sorted in their declaration order if SORT_CREATOR_PROPERTIES_FIRST is also enabled. This is usually used to prevent alphabetic sorting for Creator properties even if SORT_PROPERTIES_ALPHABETICALLY is enabled for other types of properties.

Note

if SORT_CREATOR_PROPERTIES_FIRST is disabled, this feature has no effect.

Feature is disabled by default (for backwards compatibility) in 2.x

Note

This feature will be removed in Jackson 3: the default behavior will be same as if this feature was enabled.

Since
2.18
SORT_CREATOR_PROPERTIES_FIRSTback to summary
public static final MapperFeature SORT_CREATOR_PROPERTIES_FIRST

Feature that defines whether Creator properties (ones passed through constructor or static factory method) should be sorted before other properties for which no explicit order is specified, in case where alphabetic ordering is to be used for such properties. Note that in either case explicit order (whether by name or by index) will have precedence over this setting.

Note

does not apply to java.util.Map serialization (since entries are not considered Bean/POJO properties.

Warning

Disabling it may have a negative impact on deserialization performance. When disabled, all properties before the last creator property in the input need to be buffered, since all creator properties are required to create the instance. Enabling this feature ensures that there is as little buffering as possible.

Feature is enabled by default.

Since
2.12
SORT_PROPERTIES_ALPHABETICALLYback to summary
public static final MapperFeature SORT_PROPERTIES_ALPHABETICALLY

Feature that defines default property serialization order used for POJO properties. If enabled, default ordering is alphabetic (similar to how com.fasterxml.jackson.annotation.JsonPropertyOrder#alphabetic() works); if disabled, order is unspecified (based on what JDK gives us, which may be declaration order, but is not guaranteed).

Note that this is just the default behavior and can be overridden by explicit overrides in classes (for example with com.fasterxml.jackson.annotation.JsonPropertyOrder annotation)

Note

does not apply to java.util.Map serialization (since entries are not considered Bean/POJO properties.

Feature is disabled by default.

USE_ANNOTATIONSback to summary
public static final MapperFeature USE_ANNOTATIONS

Feature that determines whether annotation introspection is used for configuration; if enabled, configured AnnotationIntrospector will be used: if disabled, no annotations are considered.

Feature is enabled by default.

USE_BASE_TYPE_AS_DEFAULT_IMPLback to summary
public static final MapperFeature USE_BASE_TYPE_AS_DEFAULT_IMPL

Feature that specifies whether the declared base type of a polymorphic value is to be used as the "default" implementation, if no explicit default class is specified via @JsonTypeInfo.defaultImpl annotation.

Note that feature only has effect on deserialization of regular polymorphic properties: it does NOT affect non-polymorphic cases, and is unlikely to work with Default Typing.

Feature is disabled by default for backwards compatibility.

Since
2.10
USE_GETTERS_AS_SETTERSback to summary
public static final MapperFeature USE_GETTERS_AS_SETTERS

Feature that determines whether otherwise regular "getter" methods (but only ones that handle Collections and Maps, not getters of other type) can be used for purpose of getting a reference to a Collection and Map to modify the property, without requiring a setter method. This is similar to how JAXB framework sets Collections and Maps: no setter is involved, just getter.

Note that such getters-as-setters methods have lower precedence than setters, so they are only used if no setter is found for the Map/Collection property.

Feature is enabled by default.

USE_STATIC_TYPINGback to summary
public static final MapperFeature USE_STATIC_TYPING

Feature that determines whether the type detection for serialization should be using actual dynamic runtime type, or declared static type. Note that deserialization always uses declared static types since no runtime types are available (as we are creating instances after using type information).

This global default value can be overridden at class, method or field level by using JsonSerialize#typing annotation property.

Feature is disabled by default which means that dynamic runtime types are used (instead of declared static types) for serialization.

USE_STD_BEAN_NAMINGback to summary
public static final MapperFeature USE_STD_BEAN_NAMING

Feature that may be enabled to enforce strict compatibility with Bean name introspection, instead of slightly different mechanism Jackson defaults to. Specific difference is that Jackson always lower cases leading upper-case letters, so "getURL()" becomes "url" property; whereas standard Bean naming only lower-cases the first letter if it is NOT followed by another upper-case letter (so "getURL()" would result in "URL" property).

Feature is disabled by default for backwards compatibility purposes: earlier Jackson versions used Jackson's own mechanism.

Since
2.5
USE_WRAPPER_NAME_AS_PROPERTY_NAMEback to summary
public static final MapperFeature USE_WRAPPER_NAME_AS_PROPERTY_NAME

Feature that can be enabled to make property names be overridden by wrapper name (usually detected with annotations as defined by AnnotationIntrospector#findWrapperName. If enabled, all properties that have associated non-empty Wrapper name will use that wrapper name instead of property name. If disabled, wrapper name is only used for wrapping (if anything).

Feature is disabled by default.

Since
2.1

Constructor Detail

MapperFeatureback to summary
private MapperFeature(boolean defaultState)

Method Detail

collectLongDefaultsback to summary
public static long collectLongDefaults()
enabledByDefaultback to summary
public boolean enabledByDefault()

Implements com.fasterxml.jackson.databind.cfg.ConfigFeature.enabledByDefault.

Doc from com.fasterxml.jackson.databind.cfg.ConfigFeature.enabledByDefault.

Accessor for checking whether this feature is enabled by default.

Annotations
@Override
enabledInback to summary
public boolean enabledIn(int flags)

Implements com.fasterxml.jackson.databind.cfg.ConfigFeature.enabledIn.

Doc from com.fasterxml.jackson.databind.cfg.ConfigFeature.enabledIn.

Deprecated

Convenience method for checking whether feature is enabled in given bitmask

Annotations
@Override
@Deprecated
enabledInback to summary
public boolean enabledIn(long flags)
getLongMaskback to summary
public long getLongMask()
getMaskback to summary
public int getMask()

Implements com.fasterxml.jackson.databind.cfg.ConfigFeature.getMask.

Doc from com.fasterxml.jackson.databind.cfg.ConfigFeature.getMask.

Deprecated

Returns bit mask for this feature instance

Annotations
@Override
@Deprecated
valueOfback to summary
public static MapperFeature valueOf(String name)
valuesback to summary
public static MapperFeature[] values()