TreeNode and is usable
via matching com.fasterxml.jackson.core.TreeCodec
implementation (see JacksonJrsTreeCodec).
| Modifier and Type | Class and Description |
|---|---|
| public abstract static class | JrsValue.
Intermediate base class for non-structured types, other than
|
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected abstract JrsValue | |
| public String | asText()
Method that may be called on scalar value nodes to get a textual representation of contents. |
| public JrsValue | at(JsonPointer
JsonPointer expression for descendant node to returnImplements com. Method for locating node specified by given JSON pointer instances. |
| public JrsValue | at(String
Expression to compile as a s)JsonPointer
instanceImplements com. Convenience method that is functionally equivalent to: return at(JsonPointer.valueOf(jsonPointerExpression)); |
| public Iterator | fieldNames()
Implements com. Method for accessing names of all fields for this node, if (and only if) this node is an Object node. |
| public abstract JrsValue | get(String
Name of the field (of Object node) to access s)Redeclares com. Method for accessing value of the specified field of an object node. |
| public abstract JrsValue | get(int
Index of the Array node element to access i)Redeclares com. Method for accessing value of the specified element of an array node. |
| public boolean | isArray()
Implements com. Method that returns true if this node is an Array node, false otherwise. |
| public boolean | |
| public boolean | isMissingNode()
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. |
| public boolean | |
| public boolean | isNumber()
Method that allows checking whether this value is a JSON number (integer or floating-point). |
| public boolean | isObject()
Implements com. Method that returns true if this node is an Object node, false otherwise. |
| public JsonParser. | numberType()
Implements com. If this node is a numeric type (as per |
| public abstract JrsValue | path(String
Name of the field (of Object node) to access s)Redeclares com. Method for accessing value of the specified field of an object node. |
| public abstract JrsValue | path(int
Index of the Array node element to access i)Redeclares com. Method for accessing value of the specified element of an array node. |
| public JsonParser | traverse()
Implements com. Method for constructing a |
| public JsonParser | traverse(ObjectCodec
ObjectCodec to associate with parser constructedImplements com. Same as |
| protected abstract void |
| JrsValue | back to summary |
|---|---|
| public JrsValue() | |
| _at | back to summary |
|---|---|
| protected abstract JrsValue _at(JsonPointer ptr) | |
| asText | back to summary |
|---|---|
| public String asText() Method that may be called on scalar value nodes to get a textual representation of contents. Returns `null` for structured values (Arrays, Objects), textual representation for other types. | |
| at | back to summary |
|---|---|
| public JrsValue at(JsonPointer ptr) Implements com. Doc from com. Method for locating node specified by given JSON pointer instances.
Method will never return null; if no matching node exists,
will return a node for which
| |
| at | back to summary |
|---|---|
| public JrsValue at(String s) Implements com. Doc from com. Convenience method that is functionally equivalent to: return at(JsonPointer.valueOf(jsonPointerExpression));
Note that if the same expression is used often, it is preferable to construct
| |
| fieldNames | back to summary |
|---|---|
| public Iterator Implements com. Doc from com. Method for accessing names of all fields for this node, if (and only if)
this node is an Object node. Number of field names accessible
will be | |
| get | back to summary |
|---|---|
| public abstract JrsValue get(String s) Redeclares 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 handling of explicit null values may vary between implementations; some trees may retain explicit nulls, others not. | |
| get | back to summary |
|---|---|
| public abstract JrsValue get(int i) Redeclares com. Doc from com. Method for accessing value of the specified element of an array node. For other nodes, null is 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
| |
| isArray | back to summary |
|---|---|
| public boolean isArray() Implements com. Doc from com. Method that returns true if this node is an Array node, false
otherwise.
Note that if true is returned,
| |
| isEmbeddedValue | back to summary |
|---|---|
| public boolean isEmbeddedValue() | |
| isMissingNode | back to summary |
|---|---|
| public boolean isMissingNode() 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
| |
| isNull | back to summary |
|---|---|
| public boolean isNull() | |
| isNumber | back to summary |
|---|---|
| public boolean isNumber() Method that allows checking whether this value is a JSON number (integer or floating-point). | |
| isObject | back to summary |
|---|---|
| public boolean isObject() Implements com. Doc from com. Method that returns true if this node is an Object node, false
otherwise.
Note that if true is returned,
| |
| numberType | back to summary |
|---|---|
| public JsonParser. Implements com. Doc from com. If this node is a numeric type (as per
| |
| path | back to summary |
|---|---|
| public abstract JrsValue path(String s) Redeclares com. Doc from com. Method for accessing value of the specified field of
an object node.
For other nodes, a "missing node" (virtual node
for which | |
| path | back to summary |
|---|---|
| public abstract JrsValue path(int i) Redeclares com. Doc from com. Method for accessing value of the specified element of
an array node.
For other nodes, a "missing node" (virtual node
for which
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
| |
| traverse | back to summary |
|---|---|
| public JsonParser traverse() Implements com. Doc from com. Method for constructing a Note constructed parser instance will NOT initially point to a token,
so before passing it to deserializers, it is typically necessary to
advance it to the first available token by calling
Also note that calling this method will NOT pass
| |
| traverse | back to summary |
|---|---|
| public JsonParser traverse(ObjectCodec codec) Implements com. Doc from com. Same as Note constructed parser instance will NOT initially point to a token,
so before passing it to deserializers, it is typically necessary to
advance it to the first available token by calling
| |
| write | back to summary |
|---|---|
| protected abstract void write(JsonGenerator g, JacksonJrsTreeCodec codec) throws IOException | |
JrsMissing.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected JrsValue | |
| public JrsValue | get(String
Name of the field (of Object node) to access s)Implements abstract com. Implements com. Method for accessing value of the specified field of an object node. |
| public JrsValue | get(int
Index of the Array node element to access i)Implements abstract com. Implements com. Method for accessing value of the specified element of an array node. |
| public final boolean | isContainerNode()
Implements com. Method that returns true for container nodes: Arrays and Objects. |
| public final boolean | isValueNode()
Implements com. Method that returns true for all value nodes: ones that are not containers, and that do not represent "missing" nodes in the path. |
| public JrsValue | path(String
Name of the field (of Object node) to access s)Implements abstract com. Implements com. Method for accessing value of the specified field of an object node. |
| public JrsValue | path(int
Index of the Array node element to access i)Implements abstract com. Implements com. Method for accessing value of the specified element of an array node. |
| public int | size()
Implements com. Method that returns number of child nodes this node contains: for Array nodes, number of child elements, for Object nodes, number of fields, and for all other nodes 0. |
| Scalar | back to summary |
|---|---|
| public Scalar() | |
| _at | back to summary |
|---|---|
| protected JrsValue _at(JsonPointer ptr) Implements abstract com.
| |
| get | back to summary |
|---|---|
| public JrsValue get(String s) Implements abstract 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 handling of explicit null values may vary between implementations; some trees may retain explicit nulls, others not. | |
| get | back to summary |
|---|---|
| public JrsValue get(int i) 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 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
| |
| isContainerNode | back to summary |
|---|---|
| public final boolean isContainerNode() Implements com. Doc from com. Method that returns true for container nodes: Arrays and Objects. Note one and only one of methods
| |
| isValueNode | back to summary |
|---|---|
| public final boolean isValueNode() Implements com. Doc from com. Method that returns true for all value nodes: ones that are not containers, and that do not represent "missing" nodes in the path. Such value nodes represent String, Number, Boolean and null values from JSON. Note one and only one of methods
| |
| path | back to summary |
|---|---|
| public JrsValue path(String s) Implements abstract com. Implements com. Doc from com. Method for accessing value of the specified field of
an object node.
For other nodes, a "missing node" (virtual node
for which | |
| path | back to summary |
|---|---|
| public JrsValue path(int i) Implements abstract com. Implements com. Doc from com. Method for accessing value of the specified element of
an array node.
For other nodes, a "missing node" (virtual node
for which
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
| |
| size | back to summary |
|---|---|
| public int size() Implements com. Doc from com. Method that returns number of child nodes this node contains: for Array nodes, number of child elements, for Object nodes, number of fields, and for all other nodes 0.
| |