| Modifier and Type | Field and Description |
|---|---|
| private static final long |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected JsonNode | _at(JsonPointer
Path expression to use ptr)Implements abstract com. 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, |
| public abstract JsonToken | asToken()
Redeclares com. Implements abstract com. Method that can be used for efficient type detection when using stream abstraction for traversing nodes. |
| public <T extends JsonNode> T | deepCopy()
Implements abstract com. All current value nodes are immutable, so we can just return them as is. |
| public final ObjectNode | findParent(String
Name of field to look for fieldName)Implements abstract com. Method for finding a JSON Object that contains specified field, within this node or its descendants. |
| public final List | findParents(String fieldName, List<JsonNode> foundSoFar)
Implements abstract com.
|
| public final JsonNode | findValue(String
Name of field to look for fieldName)Implements abstract com. Method for finding the first JSON Object field with specified name in this node or its child nodes, and returning value it has. |
| public final List | findValues(String fieldName, List<JsonNode> foundSoFar)
Implements abstract com.
|
| public final List | findValuesAsText(String fieldName, List<String> foundSoFar)
Implements abstract com.
|
| public final JsonNode | get(int
Index of the Array node element to access index)Implements abstract com. Implements com. Method for accessing value of the specified element of an array node. |
| public final JsonNode | get(String
Name of the field (of Object node) to access fieldName)Overrides com. Implements com. Method for accessing value of the specified field of an object node. |
| public final boolean | has(int
Index to check index)Overrides com. Method that allows checking whether this node is JSON Array node and contains a value for specified index If this is the case (including case of specified indexing having null as value), returns true; otherwise returns false. |
| public final boolean | has(String
Name of element to check fieldName)Overrides com. Method that allows checking whether this node is JSON Object node and contains value for specified property. |
| public final boolean | hasNonNull(int index)
Overrides com. Method that is similar to |
| public final boolean | hasNonNull(String fieldName)
Overrides com. Method that is similar to |
| public boolean | isEmpty()
Overrides com. Convenience method that is functionally same as:
size() == 0
|
| public final JsonNode | path(int
Index of the Array node element to access index)Implements abstract com. Implements com. This method is similar to |
| public final JsonNode | path(String
Name of the field (of Object node) to access fieldName)Implements abstract com. Implements com. This method is similar to |
| public void | serializeWithType(JsonGenerator g, SerializerProvider provider, TypeSerializer typeSer)
Implements abstract com. Implements com. Type information is needed, even if JsonNode instances are "plain" JSON, since they may be mixed with other types. |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides com. | |
| ValueNode | back to summary |
|---|---|
| protected ValueNode() | |
| _at | back to summary |
|---|---|
| protected JsonNode _at(JsonPointer ptr) Implements abstract com. Doc from com. 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,
| |
| asToken | back to summary |
|---|---|
| public abstract JsonToken asToken() Redeclares com. Implements abstract 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() Implements abstract com. All current value nodes are immutable, so we can just return them as is.
| |
| findParent | back to summary |
|---|---|
| public final ObjectNode findParent(String fieldName) Implements abstract com. Doc from com. 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 final List Implements abstract com.
| |
| findValue | back to summary |
|---|---|
| public final JsonNode findValue(String fieldName) Implements abstract com. Doc from com. 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 final List Implements abstract com.
| |
| findValuesAsText | back to summary |
|---|---|
| public final List Implements abstract com.
| |
| get | back to summary |
|---|---|
| public final JsonNode get(int index) Implements abstract com. Implements com. Doc from com. 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
| |
| get | back to summary |
|---|---|
| public final JsonNode get(String fieldName) Overrides com. Implements com. Doc from com. Method for accessing value of the specified field of an object node. If this node is not an object (or it does not have a value for specified field name), or if there is no field with such name, null is returned. Note if the property value has been explicitly set as
| |
| has | back to summary |
|---|---|
| public final boolean has(int index) Overrides com. Doc from com. Method that allows checking whether this node is JSON Array node and contains a value for specified index If this is the case (including case of specified indexing having null as value), returns true; otherwise returns false. Note array element indexes are 0-based. This method is equivalent to: node.get(index) != null Note this method will return
| |
| has | back to summary |
|---|---|
| public final boolean has(String fieldName) Overrides com. Doc from com. Method that allows checking whether this node is JSON Object node and contains value for specified property. If this is the case (including properties with explicit null values), returns true; otherwise returns false. This method is equivalent to: node.get(fieldName) != null(since return value of get() is node, not value node contains) Note when explicit | |
| hasNonNull | back to summary |
|---|---|
| public final boolean hasNonNull(int index) Overrides com. Doc from com. Method that is similar to This method is equivalent to: node.get(index) != null && !node.get(index).isNull()
| |
| hasNonNull | back to summary |
|---|---|
| public final boolean hasNonNull(String fieldName) Overrides com. Doc from com. Method that is similar to This method is functionally equivalent to: node.get(fieldName) != null && !node.get(fieldName).isNull()
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Overrides com. Doc from com. Convenience method that is functionally same as:
size() == 0
for all node types.
| |
| path | back to summary |
|---|---|
| public final JsonNode path(int index) Implements abstract com. Implements com. Doc from com. This method is similar to
| |
| path | back to summary |
|---|---|
| public final JsonNode path(String fieldName) Implements abstract com. Implements com. Doc from com. This method is similar to
| |
| serializeWithType | back to summary |
|---|---|
| public void serializeWithType(JsonGenerator g, SerializerProvider provider, TypeSerializer typeSer) throws IOException Implements abstract 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.
| |