JsonNode
implementations.
The main addition here is that we declare that sub-classes must
implement JacksonSerializable.
This simplifies object mapping aspects a bit, as no external serializers are needed.
Note that support for java. is added here and so all subtypes
are fully JDK serializable: but also note that serialization is as JSON and should
only be used for interoperability purposes where other approaches are not available.
| Modifier and Type | Field and Description |
|---|---|
| protected static final Optional | |
| protected static final Optional | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected Boolean | Returns: Coerced value if possible; otherwisenull to indicate this
node cannot be coerced.Method sub-classes should override if they can produce |
| protected String | Returns: Coerced value if possible; otherwisenull to indicate this
node cannot be coerced.Method sub-classes should override if they can produce |
| protected JsonPointer | |
| protected BigDecimal | |
| protected BigInteger | |
| protected BigInteger | |
| protected <T> T | |
| protected double | |
| protected float | |
| protected int | |
| protected int | |
| protected int | |
| protected long | |
| protected long | |
| protected long | |
| protected short | |
| protected short | |
| protected <T> T | _reportWrongNodeType(String msgTemplate, Object... args)
Helper method that throws |
| protected abstract String | _valueDesc()
Method for implementation classes to return a short description of contained value, to be used in error messages. |
| protected ArrayNode | _withArray(JsonPointer origPtr, JsonPointer currentPtr, JsonNode.
|
| protected ObjectNode | _withObject(JsonPointer origPtr, JsonPointer currentPtr, JsonNode.
|
| protected boolean | |
| protected void | _withXxxVerifyReplace(JsonPointer origPtr, JsonPointer currentPtr, JsonNode.
|
| public BigInteger | asBigInteger()
Implements abstract tools. Method similar to
|
| public BigInteger | asBigInteger(BigInteger defaultValue)
Implements abstract tools. Method similar to |
| public Optional | asBigIntegerOpt()
Implements abstract tools. Method similar to |
| public boolean | asBoolean()
Implements abstract tools. Method that will try to convert value of this node to a Java |
| public boolean | asBoolean(boolean defaultValue)
Implements abstract tools. Similar to |
| public Optional | asBooleanOpt()
Implements abstract tools. Similar to |
| public BigDecimal | asDecimal()
Implements abstract tools. Method that will try to access value of this node as a |
| public BigDecimal | asDecimal(BigDecimal defaultValue)
Implements abstract tools. Method similar to |
| public Optional | asDecimalOpt()
Implements abstract tools. Method similar to |
| public double | asDouble()
Implements abstract tools. Method similar to
|
| public double | asDouble(double defaultValue)
Implements abstract tools. Method similar to |
| public OptionalDouble | asDoubleOpt()
Implements abstract tools. Method similar to |
| public float | asFloat()
Implements abstract tools. Method similar to
|
| public float | asFloat(float defaultValue)
Implements abstract tools. Method similar to |
| public Optional | asFloatOpt()
Implements abstract tools. Method similar to |
| public int | asInt()
Implements abstract tools. Method similar to
|
| public int | asInt(int defaultValue)
Implements abstract tools. Method similar to |
| public OptionalInt | asIntOpt()
Implements abstract tools. Method similar to |
| public long | asLong()
Implements abstract tools. Method similar to
|
| public long | asLong(long defaultValue)
Implements abstract tools. Method similar to |
| public OptionalLong | asLongOpt()
Implements abstract tools. Method similar to |
| public short | asShort()
Implements abstract tools. Method similar to
|
| public short | asShort(short defaultValue)
Implements abstract tools. Method similar to |
| public Optional | asShortOpt()
Implements abstract tools. Method similar to |
| public String | asString()
Implements abstract tools. Method that will try to convert value of this node to a |
| public String | asString(String defaultValue)
Implements abstract tools. Similar to |
| public Optional | asStringOpt()
Implements abstract tools. Similar to |
| public abstract JsonToken | asToken()
Redeclares tools. Method that can be used for efficient type detection when using stream abstraction for traversing nodes. |
| public BigInteger | bigIntegerValue()
Implements abstract tools. Method that will try to access value of this node as a |
| public BigInteger | bigIntegerValue(BigInteger defaultValue)
Implements abstract tools. Method similar to |
| public Optional | bigIntegerValueOpt()
Implements abstract tools. Method similar to |
| public byte[] | binaryValue()
Implements abstract tools. Method that will try to access value of this node as binary value (Java |
| public boolean | booleanValue()
Implements abstract tools. Method that will try to access value of this node as a Java |
| public boolean | booleanValue(boolean defaultValue)
Implements abstract tools. Method similar to |
| public Optional | booleanValueOpt()
Implements abstract tools. Method similar to |
| public BigDecimal | decimalValue()
Implements abstract tools. Method that will try to access value of this node as a Java |
| public BigDecimal | decimalValue(BigDecimal defaultValue)
Implements abstract tools. Method similar to |
| public Optional | decimalValueOpt()
Implements abstract tools. Method similar to |
| public double | doubleValue()
Implements abstract tools. Method that will try to access value of this node as a |
| public double | doubleValue(double defaultValue)
Implements abstract tools. Method similar to |
| public OptionalDouble | doubleValueOpt()
Implements abstract tools. Method similar to |
| public final JsonNode | findPath(String fieldName)
Implements abstract tools. Method similar to |
| public float | floatValue()
Implements abstract tools. Method that will try to access value of this node as a Java |
| public float | floatValue(float defaultValue)
Implements abstract tools. Method similar to |
| public Optional | floatValueOpt()
Implements abstract tools. Method similar to |
| public abstract int | |
| public int | intValue()
Implements abstract tools. Method that will try to access value of this node as a Java |
| public int | intValue(int defaultValue)
Implements abstract tools. Method similar to |
| public OptionalInt | intValueOpt()
Implements abstract tools. Method similar to |
| public boolean | isEmbeddedValue()
Implements tools. Method that returns true if this node represents an embedded "foreign" (or perhaps native?) object (like POJO), not represented as regular content. |
| public boolean | isMissingNode()
Overrides tools. Implements tools. Method that returns true for "virtual" nodes which represent missing entries constructed by path accessor methods when there is no actual node matching given criteria. |
| public long | longValue()
Implements abstract tools. Method that will try to access value of this node as a Java |
| public long | longValue(long defaultValue)
Implements abstract tools. Method similar to |
| public OptionalLong | longValueOpt()
Implements abstract tools. Method similar to |
| public JsonParser. | numberType()
Implements tools. Returns code that identifies type of underlying numeric value, if (and only if) node is a number node. |
| public Number | numberValue()
Implements abstract tools. Method that will try to access value of this node as |
| public JsonNode | required(String fieldName)
Implements abstract tools. Method is functionally equivalent to
|
| public JsonNode | required(int index)
Implements abstract tools. Method is functionally equivalent to
|
| public abstract void | serialize(JsonGenerator jgen, SerializationContext ctxt)
Redeclares tools. Method called to serialize node instances using given generator. |
| public abstract void | serializeWithType(JsonGenerator jgen, SerializationContext ctxt, TypeSerializer typeSer)
Redeclares tools. Type information is needed, even if JsonNode instances are "plain" JSON, since they may be mixed with other types. |
| public short | shortValue()
Implements abstract tools. Method that will try to access value of this node as 16-bit signed
integer value (Java |
| public short | shortValue(short defaultValue)
Implements abstract tools. Method similar to |
| public Optional | shortValueOpt()
Implements abstract tools. Method similar to |
| public String | stringValue()
Implements abstract tools. Method that will try to access value of this node as a Java |
| public String | stringValue(String defaultValue)
Implements abstract tools. Method similar to |
| public Optional | stringValueOpt()
Implements abstract tools. Method similar to |
| public String | toPrettyString()
Overrides tools. Alternative to |
| public String | toString()
Implements abstract tools. Method that will produce (as of Jackson 2.10) valid JSON using default settings of databind, as String. |
| public JsonParser | traverse(ObjectReadContext readCtxt)
Implements tools. Method for constructing a |
| public ArrayNode | withArray(JsonPointer ptr, JsonNode.
Overrides tools. Method that can be called on Object or Array nodes, to access a Array-valued
node pointed to by given |
| public ObjectNode | withObject(JsonPointer ptr, JsonNode.
Overrides tools. Method that can be called on Object or Array nodes, to access a Object-valued
node pointed to by given |
| pack-priv Object |