|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.fasterxml.jackson.databind.JsonNode com.fasterxml.jackson.databind.node.BaseJsonNode com.fasterxml.jackson.databind.node.ValueNode
public abstract class ValueNode
This intermediate base class is used for all leaf nodes, that is, all non-container (array or object) nodes, except for the "missing node".
Field Summary |
---|
Fields inherited from class com.fasterxml.jackson.databind.JsonNode |
---|
NO_NODES, NO_STRINGS |
Constructor Summary | |
---|---|
protected |
ValueNode()
|
Method Summary | ||
---|---|---|
abstract com.fasterxml.jackson.core.JsonToken |
asToken()
Method that can be used for efficient type detection when using stream abstraction for traversing nodes. |
|
|
deepCopy()
All current value nodes are immutable, so we can just return them as is. |
|
boolean |
isValueNode()
Method that returns true for all value nodes: ones that are not containers, and that do not represent "missing" nodes in the path. |
|
JsonNode |
path(int index)
This method is similar to JsonNode.get(int) , except
that instead of returning null if no such element exists (due
to index being out of range, or this node not being an array),
a "missing node" (node that returns true for
JsonNode.isMissingNode() ) will be returned. |
|
JsonNode |
path(String fieldName)
This method is similar to JsonNode.get(String) , except
that instead of returning null if no such value exists (due
to this node not being an object, or object not having value
for the specified field),
a "missing node" (node that returns true for
JsonNode.isMissingNode() ) will be returned. |
|
void |
serializeWithType(com.fasterxml.jackson.core.JsonGenerator jg,
SerializerProvider provider,
TypeSerializer typeSer)
Type information is needed, even if JsonNode instances are "plain" JSON, since they may be mixed with other types. |
|
String |
toString()
Note: marked as abstract to ensure all implementation classes define it properly. |
Methods inherited from class com.fasterxml.jackson.databind.node.BaseJsonNode |
---|
findParent, findParents, findPath, findValue, findValues, findValuesAsText, numberType, serialize, traverse |
Methods inherited from class com.fasterxml.jackson.databind.JsonNode |
---|
asBoolean, asBoolean, asDouble, asDouble, asInt, asInt, asLong, asLong, asText, bigIntegerValue, binaryValue, booleanValue, canConvertToInt, canConvertToLong, decimalValue, doubleValue, elements, equals, fieldNames, fields, findParents, findValues, findValuesAsText, get, get, has, has, intValue, isArray, isBigDecimal, isBigInteger, isBinary, isBoolean, isContainerNode, isDouble, isFloatingPointNumber, isInt, isIntegralNumber, isLong, isMissingNode, isNull, isNumber, isObject, isPojo, isTextual, iterator, longValue, numberValue, size, textValue, with, withArray |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected ValueNode()
Method Detail |
---|
public <T extends JsonNode> T deepCopy()
deepCopy
in class JsonNode
public boolean isValueNode()
JsonNode
Note: one and only one of methods JsonNode.isValueNode()
,
JsonNode.isContainerNode()
and JsonNode.isMissingNode()
ever
returns true for any given node.
isValueNode
in class JsonNode
public abstract com.fasterxml.jackson.core.JsonToken asToken()
BaseJsonNode
JsonToken
that equivalent
stream event would produce (for most nodes there is just
one token but for structured/container types multiple)
asToken
in interface com.fasterxml.jackson.core.TreeNode
asToken
in class BaseJsonNode
public void serializeWithType(com.fasterxml.jackson.core.JsonGenerator jg, SerializerProvider provider, TypeSerializer typeSer) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
BaseJsonNode
serializeWithType
in interface JsonSerializable
serializeWithType
in class BaseJsonNode
IOException
com.fasterxml.jackson.core.JsonProcessingException
public JsonNode path(String fieldName)
JsonNode
JsonNode.get(String)
, except
that instead of returning null if no such value exists (due
to this node not being an object, or object not having value
for the specified field),
a "missing node" (node that returns true for
JsonNode.isMissingNode()
) will be returned. This allows for
convenient and safe chained access via path calls.
path
in class JsonNode
public JsonNode path(int index)
JsonNode
JsonNode.get(int)
, except
that instead of returning null if no such element exists (due
to index being out of range, or this node not being an array),
a "missing node" (node that returns true for
JsonNode.isMissingNode()
) will be returned. This allows for
convenient and safe chained access via path calls.
path
in class JsonNode
public String toString()
JsonNode
Note: marked as abstract to ensure all implementation classes define it properly.
toString
in class JsonNode
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |