public abstract class ValueNode extends BaseJsonNode
NO_NODES, NO_STRINGS
Modifier | Constructor and Description |
---|---|
protected |
ValueNode() |
Modifier and Type | Method and Description |
---|---|
abstract JsonToken |
asToken()
Method that can be used for efficient type detection
when using stream abstraction for traversing nodes.
|
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(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.
|
findParent, findParents, findPath, findValue, findValues, findValuesAsText, getNumberType, serialize, traverse
asBoolean, asBoolean, asDouble, asDouble, asInt, asInt, asLong, asLong, asText, equals, findParents, findValues, findValuesAsText, get, get, getBigIntegerValue, getBinaryValue, getBooleanValue, getDecimalValue, getDoubleValue, getElements, getFieldNames, getFields, getIntValue, getLongValue, getNumberValue, getPath, getPath, getTextValue, getValueAsBoolean, getValueAsBoolean, getValueAsDouble, getValueAsDouble, getValueAsInt, getValueAsInt, getValueAsLong, getValueAsLong, getValueAsText, has, has, isArray, isBigDecimal, isBigInteger, isBinary, isBoolean, isContainerNode, isDouble, isFloatingPointNumber, isInt, isIntegralNumber, isLong, isMissingNode, isNull, isNumber, isObject, isPojo, isTextual, iterator, size, with
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 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 class BaseJsonNode
public void serializeWithType(JsonGenerator jg, SerializerProvider provider, TypeSerializer typeSer) throws IOException, JsonProcessingException
BaseJsonNode
serializeWithType
in interface JsonSerializableWithType
serializeWithType
in class BaseJsonNode
IOException
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.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.