java.lang.Object
tools.jackson.databind.JacksonSerializable.Base
tools.jackson.databind.JsonNode
tools.jackson.databind.node.BaseJsonNode
tools.jackson.databind.node.ValueNode
tools.jackson.databind.node.NullNode
- All Implemented Interfaces:
Serializable
,Iterable<JsonNode>
,tools.jackson.core.TreeNode
,JacksonSerializable
This singleton value class is used to contain explicit JSON null
value.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class tools.jackson.databind.JsonNode
JsonNode.OverwriteMode
Nested classes/interfaces inherited from interface tools.jackson.databind.JacksonSerializable
JacksonSerializable.Base
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
Method for implementation classes to return a short description of contained value, to be used in error messages.asString()
Method that will return a valid String representation of the contained value, if the node is a value node (methodJsonNode.isValueNode()
returns true), otherwise empty String.Returns the text value of this node or the provideddefaultValue
if this node does not have a text value.tools.jackson.core.JsonToken
asToken()
Method that can be used for efficient type detection when using stream abstraction for traversing nodes.deepCopy()
All current value nodes are immutable, so we can just return them as is.boolean
Equality for node objects is defined as full (deep) value equality.static NullNode
Return the type of this nodeint
hashCode()
protected Object
Method that may be called to verify thatthis
node is neither so-called "missing node" (that is, one for whichJsonNode.isMissingNode()
returnstrue
) nor "null node" (one for whichJsonNode.isNull()
returnstrue
).final void
serialize
(tools.jackson.core.JsonGenerator g, SerializationContext provider) Method called to serialize node instances using given generator.Methods inherited from class tools.jackson.databind.node.ValueNode
_at, findParent, findParents, findValue, findValues, findValuesAsString, get, get, has, has, hasNonNull, hasNonNull, isEmpty, path, path, serializeWithType
Methods inherited from class tools.jackson.databind.node.BaseJsonNode
_jsonPointerIfValid, _reportBigIntegerCoercionFractionFail, _reportCoercionFail, _reportDoubleCoercionRangeFail, _reportFloatCoercionRangeFail, _reportIntCoercionFractionFail, _reportIntCoercionRangeFail, _reportLongCoercionFractionFail, _reportLongCoercionRangeFail, _reportShortCoercionFractionFail, _reportShortCoercionRangeFail, _reportWrongNodeType, _withArray, _withObject, _withXxxMayReplace, _withXxxVerifyReplace, asBoolean, asBoolean, asDecimal, asDecimal, asDouble, asDouble, asInt, asInt, asLong, asLong, bigIntegerValue, binaryValue, booleanValue, booleanValue, booleanValueOpt, decimalValue, decimalValue, decimalValueOpt, doubleValue, doubleValue, doubleValueOpt, findPath, floatValue, intValue, intValue, intValueOpt, isEmbeddedValue, isMissingNode, longValue, longValue, longValueOpt, numberType, numberValue, required, required, shortValue, stringValue, stringValue, stringValueOpt, toPrettyString, toString, traverse, withArray, withObject
Methods inherited from class tools.jackson.databind.JsonNode
_reportRequiredViolation, _reportUnsupportedOperation, _this, asOptional, asText, asText, at, at, canConvertToExactIntegral, canConvertToInt, canConvertToLong, equals, findParents, findValues, findValuesAsString, forEachEntry, isArray, isBigDecimal, isBigInteger, isBinary, isBoolean, isContainer, isDouble, isFloat, isFloatingPointNumber, isInt, isIntegralNumber, isLong, isNull, isNumber, isObject, isPojo, isShort, isString, isTextual, isValueNode, iterator, optional, optional, properties, propertyNames, propertyStream, require, requiredAt, requiredAt, size, spliterator, textValue, values, valueStream, withArray, withArray, withArray, withArrayProperty, withObject, withObject, withObject, withObjectProperty
Methods inherited from class tools.jackson.databind.JacksonSerializable.Base
isEmpty
-
Field Details
-
instance
-
-
Constructor Details
-
NullNode
protected NullNode()
-
-
Method Details
-
getInstance
-
readResolve
-
getNodeType
Description copied from class:JsonNode
Return the type of this node- Specified by:
getNodeType
in classJsonNode
- Returns:
- the node type as a
JsonNodeType
enum value
-
asToken
public tools.jackson.core.JsonToken asToken()Description copied from class:BaseJsonNode
Method that can be used for efficient type detection when using stream abstraction for traversing nodes. Will return the firstJsonToken
that equivalent stream event would produce (for most nodes there is just one token but for structured/container types multiple) -
deepCopy
Description copied from class:ValueNode
All current value nodes are immutable, so we can just return them as is. -
_valueDesc
Description copied from class:BaseJsonNode
Method for implementation classes to return a short description of contained value, to be used in error messages.- Specified by:
_valueDesc
in classBaseJsonNode
-
asString
Description copied from class:JsonNode
Returns the text value of this node or the provideddefaultValue
if this node does not have a text value. Useful for nodes that areMissingNode
orNullNode
, ensuring a default value is returned instead of null or missing indicators.- Overrides:
asString
in classBaseJsonNode
- Parameters:
defaultValue
- The default value to return if this node's text value is absent.- Returns:
- The text value of this node, or
defaultValue
if the text value is absent.
-
asString
Description copied from class:JsonNode
Method that will return a valid String representation of the contained value, if the node is a value node (methodJsonNode.isValueNode()
returns true), otherwise empty String.NOTE: this is NOT same as
JsonNode.toString()
in that result isNOT VALID ENCODED JSON
for all nodes (but is for some, likeNumberNode
s andBooleanNode
s). -
requireNonNull
Description copied from class:JsonNode
Method that may be called to verify thatthis
node is neither so-called "missing node" (that is, one for whichJsonNode.isMissingNode()
returnstrue
) nor "null node" (one for whichJsonNode.isNull()
returnstrue
). If non-null non-missing node,this
is returned to allow chaining; otherwise exception is thrown.- Overrides:
requireNonNull
in classJsonNode
- Returns:
this
node to allow chaining
-
serialize
public final void serialize(tools.jackson.core.JsonGenerator g, SerializationContext provider) throws tools.jackson.core.JacksonException Description copied from class:BaseJsonNode
Method called to serialize node instances using given generator.- Specified by:
serialize
in interfaceJacksonSerializable
- Specified by:
serialize
in classBaseJsonNode
- Throws:
tools.jackson.core.JacksonException
-
equals
Description copied from class:JsonNode
Equality for node objects is defined as full (deep) value equality. This means that it is possible to compare complete JSON trees for equality by comparing equality of root nodes.Note: marked as abstract to ensure all implementation classes define it properly and not rely on definition from
Object
. -
hashCode
public int hashCode()- Specified by:
hashCode
in classBaseJsonNode
-