|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.fasterxml.jackson.databind.JsonNode
com.fasterxml.jackson.databind.node.BaseJsonNode
public abstract class BaseJsonNode
Abstract base class common to all standard JsonNode
implementations.
The main addition here is that we declare that sub-classes must
implement JsonSerializable.
This simplifies object mapping aspects a bit, as no external serializers are needed.
| Field Summary |
|---|
| Fields inherited from class com.fasterxml.jackson.databind.JsonNode |
|---|
NO_NODES, NO_STRINGS |
| Constructor Summary | |
|---|---|
protected |
BaseJsonNode()
|
| 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. |
ObjectNode |
findParent(String fieldName)
Method for finding a JSON Object that contains specified field, within this node or its descendants. |
List<JsonNode> |
findParents(String fieldName,
List<JsonNode> foundSoFar)
|
JsonNode |
findPath(String fieldName)
Method similar to JsonNode.findValue(java.lang.String), but that will return a
"missing node" instead of null if no field is found. |
JsonNode |
findValue(String fieldName)
Method for finding a JSON Object field with specified name in this node or its child nodes, and returning value it has. |
List<JsonNode> |
findValues(String fieldName,
List<JsonNode> foundSoFar)
|
List<String> |
findValuesAsText(String fieldName,
List<String> foundSoFar)
|
com.fasterxml.jackson.core.JsonParser.NumberType |
numberType()
Returns code that identifies type of underlying numeric value, if (and only if) node is a number node. |
abstract void |
serialize(com.fasterxml.jackson.core.JsonGenerator jgen,
SerializerProvider provider)
Method called to serialize node instances using given generator. |
abstract void |
serializeWithType(com.fasterxml.jackson.core.JsonGenerator jgen,
SerializerProvider provider,
TypeSerializer typeSer)
Type information is needed, even if JsonNode instances are "plain" JSON, since they may be mixed with other types. |
com.fasterxml.jackson.core.JsonParser |
traverse()
Method for constructing a JsonParser instance for
iterating over contents of the tree that this
node is root of. |
| Methods inherited from class com.fasterxml.jackson.databind.JsonNode |
|---|
asBoolean, asBoolean, asDouble, asDouble, asInt, asInt, asLong, asLong, asText, bigIntegerValue, binaryValue, booleanValue, canConvertToInt, canConvertToLong, decimalValue, deepCopy, 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, isValueNode, iterator, longValue, numberValue, path, path, size, textValue, toString, with, withArray |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected BaseJsonNode()
| Method Detail |
|---|
public JsonNode findValue(String fieldName)
JsonNode
findValue in class JsonNodefieldName - Name of field to look for
public final JsonNode findPath(String fieldName)
JsonNodeJsonNode.findValue(java.lang.String), but that will return a
"missing node" instead of null if no field is found. Missing node
is a specific kind of node for which JsonNode.isMissingNode()
returns true; and all value access methods return empty or
missing value.
findPath in class JsonNodefieldName - Name of field to look for
public ObjectNode findParent(String fieldName)
JsonNode
findParent in class JsonNodefieldName - Name of field to look for
public List<JsonNode> findValues(String fieldName,
List<JsonNode> foundSoFar)
findValues in class JsonNode
public List<String> findValuesAsText(String fieldName,
List<String> foundSoFar)
findValuesAsText in class JsonNode
public List<JsonNode> findParents(String fieldName,
List<JsonNode> foundSoFar)
findParents in class JsonNodepublic com.fasterxml.jackson.core.JsonParser traverse()
JsonNodeJsonParser instance for
iterating over contents of the tree that this
node is root of.
Functionally equivalent to first serializing tree using
ObjectCodec and then re-parsing but
more efficient.
traverse in interface com.fasterxml.jackson.core.TreeNodetraverse in class JsonNodepublic abstract com.fasterxml.jackson.core.JsonToken asToken()
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.TreeNodeasToken in class JsonNodepublic com.fasterxml.jackson.core.JsonParser.NumberType numberType()
numberType in interface com.fasterxml.jackson.core.TreeNodenumberType in class JsonNode
public abstract void serialize(com.fasterxml.jackson.core.JsonGenerator jgen,
SerializerProvider provider)
throws IOException,
com.fasterxml.jackson.core.JsonProcessingException
serialize in interface JsonSerializableIOException
com.fasterxml.jackson.core.JsonProcessingException
public abstract void serializeWithType(com.fasterxml.jackson.core.JsonGenerator jgen,
SerializerProvider provider,
TypeSerializer typeSer)
throws IOException,
com.fasterxml.jackson.core.JsonProcessingException
serializeWithType in interface JsonSerializableIOException
com.fasterxml.jackson.core.JsonProcessingException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||