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 |
| Modifier and Type | Method and Description |
|---|---|
| protected JsonNode | _at(JsonPointer ptr)
Implements abstract tools. Helper method used by other methods for traversing the next step
of given path expression, and returning matching value node if any:
if no match, |
| protected String | _valueDesc()
Implements abstract tools. Method for implementation classes to return a short description of contained value, to be used in error messages. |
| public Optional | asOptional()
Overrides tools. Method that will return a |
| public JsonToken | asToken()
Implements abstract tools. Implements tools. Method that can be used for efficient type detection when using stream abstraction for traversing nodes. |
| public MissingNode | deepCopy()
Implements abstract tools. Method that can be called to get a node that is guaranteed not to allow changing of this node through mutators on this node or any of its children. |
| public boolean | equals(Object o)
Implements abstract tools. Equality for node objects is defined as full (deep) value equality. |
| public JsonNode | findParent(String fieldName)
Implements abstract tools. Method for finding a JSON Object that contains specified field, within this node or its descendants. |
| public List | findParents(String fieldName, List<JsonNode> foundSoFar)
Implements abstract tools.
|
| public JsonNode | findValue(String fieldName)
Implements abstract tools. Method for finding the first JSON Object field with specified name in this node or its child nodes, and returning value it has. |
| public List | findValues(String fieldName, List<JsonNode> foundSoFar)
Implements abstract tools.
|
| public List | findValuesAsString(String fieldName, List<String> foundSoFar)
Implements abstract tools.
|
| public JsonNode | get(int index)
Implements abstract tools. Implements tools. Method for accessing value of the specified element of an array node. |
| public static MissingNode | |
| public JsonNodeType | getNodeType()
Implements abstract tools. Return the type of this node |
| public int | hashCode()
Implements abstract tools. Returns a hash code value for this object. |
| public final 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 JsonNode | path(String fieldName)
Implements abstract tools. Implements tools. This method is similar to |
| public JsonNode | path(int index)
Implements abstract tools. Implements tools. This method is similar to |
| protected Object | |
| public JsonNode | require()
Overrides tools. Method that may be called to verify that |
| public JsonNode | requireNonNull()
Overrides tools. Method that may be called to verify that |
| public final void | serialize(JsonGenerator g, SerializationContext provider)
Implements abstract tools. Implements tools. Method called to serialize node instances using given generator. |
| public void | serializeWithType(JsonGenerator g, SerializationContext provider, TypeSerializer typeSer)
Implements abstract tools. Implements tools. Type information is needed, even if JsonNode instances are "plain" JSON, since they may be mixed with other types. |
| public String | toPrettyString()
Overrides tools. Alternative to |
| public String | toString()
Overrides tools. 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 tools. | |
| MissingNode | back to summary |
|---|---|
| protected MissingNode() | |
| _at | back to summary |
|---|---|
| protected JsonNode _at(JsonPointer ptr) Implements abstract tools. Doc from tools. Helper method used by other methods for traversing the next step
of given path expression, and returning matching value node if any:
if no match,
| |
| _valueDesc | back to summary |
|---|---|
| protected String _valueDesc() Implements abstract tools. Doc from tools. Method for implementation classes to return a short description of contained value, to be used in error messages.
| |
| asOptional | back to summary |
|---|---|
| public Optional Overrides tools. Doc from tools. Method that will return a
| |
| asToken | back to summary |
|---|---|
| public JsonToken asToken() Implements abstract tools. Implements tools. Doc from tools. 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 MissingNode deepCopy() Implements abstract tools. Doc from tools. Method that can be called to get a node that is guaranteed not to allow changing of this node through mutators on this node or any of its children. This means it can either make a copy of this node (and all mutable children and grand children nodes), or node itself if it is immutable. Note return type is guaranteed to have same type as the node method is called on; which is why method is declared with local generic type.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Implements abstract tools. Doc from tools. 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
| |
| findParent | back to summary |
|---|---|
| public JsonNode findParent(String fieldName) Implements abstract tools. Doc from tools. Method for finding a JSON Object that contains specified field, within this node or its descendants. If no matching field is found in this node or its descendants, returns null.
| |
| findParents | back to summary |
|---|---|
| public List Implements abstract tools.
| |
| findValue | back to summary |
|---|---|
| public JsonNode findValue(String fieldName) Implements abstract tools. Doc from tools. Method for finding the first JSON Object field with specified name in this node or its child nodes, and returning value it has. If no matching field is found in this node or its descendants, returns null.
Note that traversal is done in document order (that is, order in which
nodes are iterated if using
| |
| findValues | back to summary |
|---|---|
| public List Implements abstract tools.
| |
| findValuesAsString | back to summary |
|---|---|
| public List Implements abstract tools.
| |
| get | back to summary |
|---|---|
| public JsonNode get(int index) Implements abstract tools. Implements tools. Doc from tools. Method for accessing value of the specified element of an array node. For other nodes, null is always returned.
For array nodes, index specifies
exact location within array and allows for efficient iteration
over child elements (underlying storage is guaranteed to
be efficiently indexable, i.e. has random-access to elements).
If index is less than 0, or equal-or-greater than
Note if the element value has been explicitly set as
| |
| getInstance | back to summary |
|---|---|
| public static MissingNode getInstance() | |
| getNodeType | back to summary |
|---|---|
| public JsonNodeType getNodeType() Implements abstract tools. Doc from tools. Return the type of this node
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Implements abstract tools. 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 final boolean isMissingNode() Overrides tools. Implements tools. Doc from 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. Note one and only one of methods
| |
| path | back to summary |
|---|---|
| public JsonNode path(String fieldName) Implements abstract tools. Implements tools. Doc from tools. This method is similar to
| |
| path | back to summary |
|---|---|
| public JsonNode path(int index) Implements abstract tools. Implements tools. Doc from tools. This method is similar to
| |
| readResolve | back to summary |
|---|---|
| protected Object readResolve() | |
| require | back to summary |
|---|---|
| public JsonNode require() Overrides tools. Doc from tools. Method that may be called to verify that
| |
| requireNonNull | back to summary |
|---|---|
| public JsonNode requireNonNull() Overrides tools. Doc from tools. Method that may be called to verify that
| |
| serialize | back to summary |
|---|---|
| public final void serialize(JsonGenerator g, SerializationContext provider) throws JacksonException Implements abstract tools. Implements tools. Doc from tools. Method called to serialize node instances using given generator.
| |
| serializeWithType | back to summary |
|---|---|
| public void serializeWithType(JsonGenerator g, SerializationContext provider, TypeSerializer typeSer) throws JacksonException Implements abstract tools. Implements tools. Doc from tools. 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 tools. Doc from tools. Alternative to
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides tools. Doc from tools. 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
| |