public static enum JsonParser.NodeInterningStrategy extends java.lang.Enum<JsonParser.NodeInterningStrategy>
JsonParser
can use for object reuse when parsing a document without streaming.Enum Constant and Description |
---|
INTERN_LEAF_NODES
Use the same object for strings and numbers in a given document that are equal.
|
INTERN_NOTHING
Use a new object for every string and number in a document.
|
Modifier and Type | Method and Description |
---|---|
static JsonParser.NodeInterningStrategy |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static JsonParser.NodeInterningStrategy[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final JsonParser.NodeInterningStrategy INTERN_LEAF_NODES
When the parser encounters a number node or a string node (including field names) equal to one it has previously encountered in the same
document, it will use the same object for them, i.e. for any two strings or numbers a
and b
in a given document, if a.equals(b)
then a == b
.
This strategy trades a reduction in memory use for a small increase in computational cost.
public static final JsonParser.NodeInterningStrategy INTERN_NOTHING
For any two equivalent strings or numbers a
and b
in a given document, a.equals(b)
, but a != b
.
This strategy minimises the computational cost of parsing at the expense of increased memory use.
public static JsonParser.NodeInterningStrategy[] values()
for (JsonParser.NodeInterningStrategy c : JsonParser.NodeInterningStrategy.values()) System.out.println(c);
public static JsonParser.NodeInterningStrategy valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null