Top Description Fields Constructors Methods
tools.jackson.databind.cfg

public final Enum JsonNodeFeature

extends Enum<JsonNodeFeature>
implements DatatypeFeature
Class Inheritance
All Implemented Interfaces
tools.jackson.databind.cfg.DatatypeFeature, tools.jackson.core.util.JacksonFeature

New Datatype-specific configuration options related to handling of tools.jackson.databind.JsonNode types.

Field Summary

Modifier and TypeField and Description
private final boolean
_enabledByDefault

Whether feature is enabled or disabled by default.

private final int
public static final JsonNodeFeature
private static final int
public static final JsonNodeFeature
READ_NULL_PROPERTIES

When reading tools.jackson.databind.JsonNodes are null valued properties included as explicit NullNodes in resulting tools.jackson.databind.node.ObjectNode or skipped?

public static final JsonNodeFeature
STRIP_TRAILING_BIGDECIMAL_ZEROES

Feature that determines whether java.math.BigDecimal values will be "normalized" by stripping trailing zeroes off, when constructing nodes with tools.jackson.databind.node.JsonNodeFactory#numberNode(java.math.BigDecimal).

public static final JsonNodeFeature
USE_BIG_DECIMAL_FOR_FLOATS

Determines whether floating-point numbers should be deserialized into java.math.BigDecimal when reading tools.jackson.databind.JsonNodes.

public static final JsonNodeFeature
WRITE_NULL_PROPERTIES

When writing JsonNodes are null valued properties written as explicit JSON nulls or skipped?

public static final JsonNodeFeature
WRITE_PROPERTIES_SORTED

When writing com.fasterxml.jackson.databind.JsonNodes are Object properties (for ObjectNodes) sorted alphabetically (using natural order of java.lang.String) or not?

Constructor Summary

AccessConstructor and Description
private
JsonNodeFeature(boolean enabledByDefault)

Method Summary

Modifier and TypeMethod and Description
public boolean
enabledByDefault()

Implements tools.jackson.core.util.JacksonFeature.enabledByDefault.

Accessor for checking whether this feature is enabled by default.

public boolean
enabledIn(int flags)

Implements tools.jackson.core.util.JacksonFeature.enabledIn.

Convenience method for checking whether feature is enabled in given bitmask.

public int
featureIndex()

Implements tools.jackson.databind.cfg.DatatypeFeature.featureIndex.

Internal index used for efficient storage and index; no user serviceable contents inside!

public int
getMask()

Implements tools.jackson.core.util.JacksonFeature.getMask.

Returns bit mask for this feature instance; must be a single bit, that is of form 1 << N.

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

Field Detail

_enabledByDefaultback to summary
private final boolean _enabledByDefault

Whether feature is enabled or disabled by default.

_maskback to summary
private final int _mask
FAIL_ON_NAN_TO_BIG_DECIMAL_COERCIONback to summary
public static final JsonNodeFeature FAIL_ON_NAN_TO_BIG_DECIMAL_COERCION

Determines the behavior when coercing `NaN` to java.math.BigDecimal with tools.jackson.databind.DeserializationFeature#USE_BIG_DECIMAL_FOR_FLOATS enabled. 1. If set to true, will throw an tools.jackson.databind.exc.InvalidFormatException for attempting to coerce NaN into java.math.BigDecimal. 2. If set to false, will simply let coercing NaN into java.math.BigDecimal happen, regardless of how such coercion will behave -- as of 2.16, will simply stay as NaN of original floating-point type node.

Default value is false for backwards-compatibility, but will most likely be changed to true in 3.0.

FEATURE_INDEXback to summary
private static final int FEATURE_INDEX
READ_NULL_PROPERTIESback to summary
public static final JsonNodeFeature READ_NULL_PROPERTIES

When reading tools.jackson.databind.JsonNodes are null valued properties included as explicit NullNodes in resulting tools.jackson.databind.node.ObjectNode or skipped?

Default value: true

STRIP_TRAILING_BIGDECIMAL_ZEROESback to summary
public static final JsonNodeFeature STRIP_TRAILING_BIGDECIMAL_ZEROES

Feature that determines whether java.math.BigDecimal values will be "normalized" by stripping trailing zeroes off, when constructing nodes with tools.jackson.databind.node.JsonNodeFactory#numberNode(java.math.BigDecimal). If enabled, java.math.BigDecimal#stripTrailingZeros() will be called prior to node creation; if disabled, numeric value will be used as is.

Default value: false (since 3.0).

USE_BIG_DECIMAL_FOR_FLOATSback to summary
public static final JsonNodeFeature USE_BIG_DECIMAL_FOR_FLOATS

Determines whether floating-point numbers should be deserialized into java.math.BigDecimal when reading tools.jackson.databind.JsonNodes. This feature provides more precise control over number deserialization for JsonNode and takes precedence over tools.jackson.databind.DeserializationFeature#USE_BIG_DECIMAL_FOR_FLOATS if explicitly set.

Behavior follows these rules:

  • If explicitly enabled, floating-point numbers will be read as java.math.BigDecimal.
  • If explicitly disabled, floating-point numbers will be read as java.lang.Double.
  • If left undefined (default), the behavior follows DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS.

Default value is false but unless explicitly set, handling depends on more general DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS).

WRITE_NULL_PROPERTIESback to summary
public static final JsonNodeFeature WRITE_NULL_PROPERTIES

When writing JsonNodes are null valued properties written as explicit JSON nulls or skipped?

Default value: true

WRITE_PROPERTIES_SORTEDback to summary
public static final JsonNodeFeature WRITE_PROPERTIES_SORTED

When writing com.fasterxml.jackson.databind.JsonNodes are Object properties (for ObjectNodes) sorted alphabetically (using natural order of java.lang.String) or not? If not sorted, order is the insertion order; when reading this also means retaining order from the input document.

Default value: false

Constructor Detail

JsonNodeFeatureback to summary
private JsonNodeFeature(boolean enabledByDefault)

Method Detail

enabledByDefaultback to summary
public boolean enabledByDefault()

Implements tools.jackson.core.util.JacksonFeature.enabledByDefault.

Doc from tools.jackson.core.util.JacksonFeature.enabledByDefault.

Accessor for checking whether this feature is enabled by default.

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

Implements tools.jackson.core.util.JacksonFeature.enabledIn.

Doc from tools.jackson.core.util.JacksonFeature.enabledIn.

Convenience method for checking whether feature is enabled in given bitmask.

Annotations
@Override
featureIndexback to summary
public int featureIndex()

Implements tools.jackson.databind.cfg.DatatypeFeature.featureIndex.

Doc from tools.jackson.databind.cfg.DatatypeFeature.featureIndex.

Internal index used for efficient storage and index; no user serviceable contents inside!

Annotations
@Override
getMaskback to summary
public int getMask()

Implements tools.jackson.core.util.JacksonFeature.getMask.

Doc from tools.jackson.core.util.JacksonFeature.getMask.

Returns bit mask for this feature instance; must be a single bit, that is of form 1 << N.

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