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. isValueNode returns true),
otherwise empty String.
|
| public String | asText(String defaultValue)
Overrides com. asText(), except that it will return
defaultValue in cases where null value would be returned;
either for missing nodes (trying to access missing property, or element
at invalid item for array) or explicit nulls.
|
| public JsonToken | asToken()
Implements abstract com. Implements com. |
| public <T extends JsonNode> T | deepCopy()
Overrides com. |
| public boolean | equals(Object
the reference object with which to compare. o)Implements abstract com. |
| public static MissingNode | |
| public JsonNodeType | getNodeType()
Implements abstract com. |
| public int | hashCode()
Implements abstract com. |
| public boolean | isMissingNode()
Overrides com. Implements com. |
| protected Object | |
| public JsonNode | require()
Overrides com. this node is NOT so-called
"missing node": that is, one for which isMissingNode() returns true.
|
| public JsonNode | requireNonNull()
Overrides com. this node is neither so-called
"missing node" (that is, one for which isMissingNode() returns true)
nor "null node" (one for which isNull() returns true).
|
| public final void | serialize(JsonGenerator g, SerializerProvider provider)
Implements abstract com. Implements com. |
| public void | serializeWithType(JsonGenerator g, SerializerProvider provider, TypeSerializer typeSer)
Overrides com. Implements com. |
| public String | toPrettyString()
Overrides com. toString that will serialize this node using
Jackson default pretty-printer.
|
| public String | toString()
Overrides com. |
| 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. Method similar to
| |
| 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 the 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
| |