One configuration option in the default implementation is that
of whether
DecimalNode instances must be built with exact representations of
BigDecimal instances; or to use "normalized" instance.
This has quite an influence since, for instance, a BigDecimal (and,
therefore, a DecimalNode) constructed from input string "1.0" and
another constructed with input string "1.00" will not be
equal unless normalized since their scale differs (1 in the first case,
2 in the second case).
Normalization, if enabled, means simply calling BigDecimal#stripTrailingZeros().
Note that configuration of "normalization" changed in 2.15:
while JsonNodeFactory still has a default setting,
the intent is to deprecate and remove this, to be replaced by
new com.
setting.
Default setting in 2.15 is to ENABLE normalization: this will likely
change at latest in Jackson 3.0 (to leave BigDecimal values as
they are).
Note, too, that this factory will no longer handle this normalization
(if enabled): caller (like com.)
is expected to handle it.
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | _cfgBigDecimalExact
Deprecated
|
| public static final JsonNodeFactory | instance
Default singleton instance that construct "standard" node instances: given that this class is stateless, a globally shared singleton can be used. |
| protected static final int | MAX_ELEMENT_INDEX_FOR_INSERT
Constant that defines maximum |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected boolean | |
| public ArrayNode | arrayNode()
Implements com. |
| public ArrayNode | arrayNode(int capacity)
Implements com. |
| public BinaryNode | binaryNode(byte[] data)
Implements com. |
| public BinaryNode | binaryNode(byte[] data, int offset, int length)
Implements com. |
| public BooleanNode | booleanNode(boolean v)
Implements com. |
| public int | |
| public JsonNode | |
| public NullNode | nullNode()
Implements com. |
| public NumericNode | numberNode(byte v)
Implements com. |
| public ValueNode | numberNode(Byte value)
Implements com. |
| public NumericNode | numberNode(short v)
Implements com. |
| public ValueNode | numberNode(Short value)
Implements com. |
| public NumericNode | numberNode(int v)
Implements com. |
| public ValueNode | numberNode(Integer value)
Implements com. |
| public NumericNode | numberNode(long v)
Implements com. |
| public ValueNode | numberNode(Long v)
Implements com. |
| public ValueNode | numberNode(BigInteger v)
Implements com. |
| public NumericNode | numberNode(float v)
Implements com. |
| public ValueNode | numberNode(Float value)
Implements com. |
| public NumericNode | numberNode(double v)
Implements com. |
| public ValueNode | numberNode(Double value)
Implements com. |
| public ValueNode | numberNode(BigDecimal v)
Implements com.
Note that regardless whether the factory has been built to normalize decimal
values (see class JavaDoc), the |
| public ObjectNode | objectNode()
Implements com. |
| public ValueNode | pojoNode(Object pojo)
Implements com. |
| public ValueNode | rawValueNode(RawValue value)
Implements com. |
| public TextNode | textNode(String text)
Implements com. |
| public boolean | |
| public static JsonNodeFactory | Returns: a factory instance with specified configurationIf {code true} DISABLE normalization of bigDecimalExact)BigDecimal values;
if {code false} ENABLE normalization
Deprecated
Use
Return a factory instance with the desired behavior for BigDecimals
com.
instead for configuring behavior.
See |
| _cfgBigDecimalExact | back to summary |
|---|---|
| private final boolean _cfgBigDecimalExact
Deprecated
| |
| instance | back to summary |
|---|---|
| public static final JsonNodeFactory instance Default singleton instance that construct "standard" node instances: given that this class is stateless, a globally shared singleton can be used. | |
| MAX_ELEMENT_INDEX_FOR_INSERT | back to summary |
|---|---|
| protected static final int MAX_ELEMENT_INDEX_FOR_INSERT Constant that defines maximum | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| JsonNodeFactory | back to summary |
|---|---|
public JsonNodeFactory(boolean bigDecimalExact)
| |
| JsonNodeFactory | back to summary |
|---|---|
| protected JsonNodeFactory() Default constructor. This calls | |
| _inIntRange | back to summary |
|---|---|
| protected boolean _inIntRange(long l) | |
| arrayNode | back to summary |
|---|---|
| public ArrayNode arrayNode() Implements com. Factory method for constructing an empty JSON Array node
| |
| arrayNode | back to summary |
|---|---|
| public ArrayNode arrayNode(int capacity) Implements com. Factory method for constructing a JSON Array node with an initial capacity
| |
| binaryNode | back to summary |
|---|---|
| public BinaryNode binaryNode(byte[] data) Implements com. Factory method for constructing a node that represents given binary data, and will get serialized as equivalent base64-encoded String value
| |
| binaryNode | back to summary |
|---|---|
| public BinaryNode binaryNode(byte[] data, int offset, int length) Implements com. Factory method for constructing a node that represents given binary data, and will get serialized as equivalent base64-encoded String value
| |
| booleanNode | back to summary |
|---|---|
| public BooleanNode booleanNode(boolean v) Implements com. Factory method for getting an instance of JSON boolean value (either literal 'true' or 'false')
| |
| getMaxElementIndexForInsert | back to summary |
|---|---|
public int getMaxElementIndexForInsert()
| |
| missingNode | back to summary |
|---|---|
| public JsonNode missingNode() | |
| nullNode | back to summary |
|---|---|
| public NullNode nullNode() Implements com. Factory method for getting an instance of JSON null node (which represents literal null value)
| |
| numberNode | back to summary |
|---|---|
| public NumericNode numberNode(byte v) Implements com. Factory method for getting an instance of JSON numeric value that expresses given 8-bit value
| |
| numberNode | back to summary |
|---|---|
| public ValueNode numberNode(Byte value) Implements com. Alternate factory method that will handle wrapper value, which may
be null.
Due to possibility of null, returning type is not guaranteed to be
| |
| numberNode | back to summary |
|---|---|
| public NumericNode numberNode(short v) Implements com. Factory method for getting an instance of JSON numeric value that expresses given 16-bit integer value
| |
| numberNode | back to summary |
|---|---|
| public ValueNode numberNode(Short value) Implements com. Alternate factory method that will handle wrapper value, which may
be null.
Due to possibility of null, returning type is not guaranteed to be
| |
| numberNode | back to summary |
|---|---|
| public NumericNode numberNode(int v) Implements com. Factory method for getting an instance of JSON numeric value that expresses given 32-bit integer value
| |
| numberNode | back to summary |
|---|---|
| public ValueNode numberNode(Integer value) Implements com. Alternate factory method that will handle wrapper value, which may
be null.
Due to possibility of null, returning type is not guaranteed to be
| |
| numberNode | back to summary |
|---|---|
| public NumericNode numberNode(long v) Implements com. Factory method for getting an instance of JSON numeric value that expresses given 64-bit integer value
| |
| numberNode | back to summary |
|---|---|
| public ValueNode numberNode(Long v) Implements com. Alternate factory method that will handle wrapper value, which may be null.
Due to possibility of null, returning type is not guaranteed to be
| |
| numberNode | back to summary |
|---|---|
| public ValueNode numberNode(BigInteger v) Implements com. Factory method for getting an instance of JSON numeric value that expresses given unlimited range integer value
| |
| numberNode | back to summary |
|---|---|
| public NumericNode numberNode(float v) Implements com. Factory method for getting an instance of JSON numeric value that expresses given 32-bit floating point value
| |
| numberNode | back to summary |
|---|---|
| public ValueNode numberNode(Float value) Implements com. Alternate factory method that will handle wrapper value, which may
be null.
Due to possibility of null, returning type is not guaranteed to be
| |
| numberNode | back to summary |
|---|---|
| public NumericNode numberNode(double v) Implements com. Factory method for getting an instance of JSON numeric value that expresses given 64-bit floating point value
| |
| numberNode | back to summary |
|---|---|
| public ValueNode numberNode(Double value) Implements com. Alternate factory method that will handle wrapper value, which may
be null.
Due to possibility of null, returning type is not guaranteed to be
| |
| numberNode | back to summary |
|---|---|
| public ValueNode numberNode(BigDecimal v) Implements com. Factory method for getting an instance of JSON numeric value that expresses given unlimited precision floating point value
Note that regardless whether the factory has been built to normalize decimal
values (see class JavaDoc), the
| |
| objectNode | back to summary |
|---|---|
| public ObjectNode objectNode() Implements com. Factory method for constructing an empty JSON Object ("struct") node
| |
| pojoNode | back to summary |
|---|---|
| public ValueNode pojoNode(Object pojo) Implements com. Factory method for constructing a wrapper for POJO ("Plain Old Java Object") objects; these will get serialized using data binding, usually as JSON Objects, but in some cases as JSON Strings or other node types.
| |
| rawValueNode | back to summary |
|---|---|
| public ValueNode rawValueNode(RawValue value) Implements com. Doc from com. Factory method to use for adding "raw values"; pre-encoded values that are included exactly as-is when node is serialized. This may be used, for example, to include fully serialized JSON sub-trees. Note that the concept may not work with all backends, and since no translation of any kinds is done it will not work when converting between data formats.
| |
| textNode | back to summary |
|---|---|
| public TextNode textNode(String text) Implements com. Factory method for constructing a node that represents JSON String value
| |
| willStripTrailingBigDecimalZeroes | back to summary |
|---|---|
| public boolean willStripTrailingBigDecimalZeroes() Accessor needed by
| |
| withExactBigDecimals | back to summary |
|---|---|
| public static JsonNodeFactory withExactBigDecimals(boolean bigDecimalExact)
Deprecated Use Return a factory instance with the desired behavior for BigDecimals See
| |