In most respects this placeholder node will act as NullNode;
for example, for purposes of value conversions, value is considered
to be null and represented as value zero when used for numeric
conversions.
| Modifier and Type | Field and Description |
|---|---|
| private static final MissingNode | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| protected | MissingNode()
Note visibility raised to `protected` in 2.9.3 to allow custom subtypes (which may not be greatest idea ever to have but was requested) |
| Modifier and Type | Method and Description |
|---|---|
| public String | asText()
Implements abstract com. Method that will return a valid String representation of
the container value, if the node is a value node
(method |
| public String | asText(String
The default value to return if this node's text value is absent. defaultValue)Overrides com. Returns the text value of this node or the provided |
| public JsonToken | asToken()
Implements abstract com. Implements com. Method that can be used for efficient type detection when using stream abstraction for traversing nodes. |
| public <T extends JsonNode> T | deepCopy()
Overrides com. All current value nodes are immutable, so we can just return them as is. |
| public boolean | equals(Object
the reference object with which to compare. o)Implements abstract com. Equality for node objects is defined as full (deep) value equality. |
| public static MissingNode | |
| public JsonNodeType | getNodeType()
Implements abstract com. Return the type of this node |
| public int | hashCode()
Implements abstract com. Returns a hash code value for this object. |
| public boolean | isMissingNode()
Overrides com. Implements com. 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. |
| protected Object | |
| public JsonNode | require()
Overrides com. Method that may be called to verify that |
| public JsonNode | requireNonNull()
Overrides com. Method that may be called to verify that |
| public final void | serialize(JsonGenerator g, SerializerProvider provider)
Implements abstract com. Implements com. Method called to serialize node instances using given generator. |
| public void | serializeWithType(JsonGenerator g, SerializerProvider provider, TypeSerializer typeSer)
Overrides com. Implements com. Type information is needed, even if JsonNode instances are "plain" JSON, since they may be mixed with other types. |
| public String | toPrettyString()
Overrides com. Alternative to |
| public String | toString()
Overrides com. Method that will produce (as of Jackson 2.10) valid JSON using default settings of databind, as String. |
| instance | back to summary |
|---|---|
| private static final MissingNode instance | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides com. | |
| MissingNode | back to summary |
|---|---|
| protected MissingNode() Note visibility raised to `protected` in 2.9.3 to allow custom subtypes (which may not be greatest idea ever to have but was requested) | |
| asText | back to summary |
|---|---|
| public String asText() Implements abstract com. Doc from com. Method that will return a valid String representation of
the container value, if the node is a value node
(method
| |
| asText | back to summary |
|---|---|
| public String asText(String defaultValue) Overrides com. Doc from com. Returns the text value of this node or the provided Note This was deprecated in 2.17.0, but as discussed through [databind#4471], was un-deprecated in 2.17.1. | |
| asToken | back to summary |
|---|---|
| public JsonToken asToken() Implements abstract com. Implements com. Doc from com. Method that can be used for efficient type detection
when using stream abstraction for traversing nodes.
Will return the first
| |
| deepCopy | back to summary |
|---|---|
| public <T extends JsonNode> T deepCopy() Overrides com. Doc from com. All current value nodes are immutable, so we can just return them as is.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Implements abstract com. Doc from com. 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
| |
| getInstance | back to summary |
|---|---|
| public static MissingNode getInstance() | |
| getNodeType | back to summary |
|---|---|
| public JsonNodeType getNodeType() Implements abstract com. Doc from com. Return the type of this node
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Implements abstract com. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isMissingNode | back to summary |
|---|---|
| public boolean isMissingNode() Overrides com. Implements com. Doc from com. 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. Note one and only one of methods
| |
| readResolve | back to summary |
|---|---|
| protected Object readResolve() | |
| require | back to summary |
|---|---|
| public JsonNode require() Overrides com. Doc from com. Method that may be called to verify that
| |
| requireNonNull | back to summary |
|---|---|
| public JsonNode requireNonNull() Overrides com. Doc from com. Method that may be called to verify that
| |
| serialize | back to summary |
|---|---|
| public final void serialize(JsonGenerator g, SerializerProvider provider) throws IOException Implements abstract com. Implements com. Doc from com. Method called to serialize node instances using given generator.
| |
| serializeWithType | back to summary |
|---|---|
| public void serializeWithType(JsonGenerator g, SerializerProvider provider, TypeSerializer typeSer) throws IOException Overrides com. Implements com. Doc from com. Type information is needed, even if JsonNode instances are "plain" JSON, since they may be mixed with other types.
| |
| toPrettyString | back to summary |
|---|---|
| public String toPrettyString() Overrides com. Doc from com. Alternative to
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides com. Doc from com. Method that will produce (as of Jackson 2.10) valid JSON using
default settings of databind, as String.
If you want other kinds of JSON output (or output formatted using one of
other Jackson-supported data formats) make sure to use
String json = objectMapper.writeValueAsString(rootNode); Note method defined as abstract to ensure all implementation
classes explicitly implement method, instead of relying
on
| |