Class BaseJsonNode
- java.lang.Object
-
- com.fasterxml.jackson.databind.JsonSerializable.Base
-
- com.fasterxml.jackson.databind.JsonNode
-
- com.fasterxml.jackson.databind.node.BaseJsonNode
-
- All Implemented Interfaces:
com.fasterxml.jackson.core.TreeNode,JsonSerializable,java.lang.Iterable<JsonNode>
- Direct Known Subclasses:
ContainerNode,ValueNode
public abstract class BaseJsonNode extends JsonNode implements JsonSerializable
Abstract base class common to all standardJsonNodeimplementations. The main addition here is that we declare that sub-classes must implementJsonSerializable. This simplifies object mapping aspects a bit, as no external serializers are needed.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.fasterxml.jackson.databind.JsonSerializable
JsonSerializable.Base
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBaseJsonNode()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract com.fasterxml.jackson.core.JsonTokenasToken()Method that can be used for efficient type detection when using stream abstraction for traversing nodes.JsonNodefindPath(java.lang.String fieldName)Method similar toJsonNode.findValue(java.lang.String), but that will return a "missing node" instead of null if no field is found.abstract inthashCode()com.fasterxml.jackson.core.JsonParser.NumberTypenumberType()Returns code that identifies type of underlying numeric value, if (and only if) node is a number node.abstract voidserialize(com.fasterxml.jackson.core.JsonGenerator jgen, SerializerProvider provider)Method called to serialize node instances using given generator.abstract voidserializeWithType(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.JsonParsertraverse()com.fasterxml.jackson.core.JsonParsertraverse(com.fasterxml.jackson.core.ObjectCodec codec)-
Methods inherited from class com.fasterxml.jackson.databind.JsonNode
_at, asBoolean, asBoolean, asDouble, asDouble, asInt, asInt, asLong, asLong, asText, asText, at, at, bigIntegerValue, binaryValue, booleanValue, canConvertToInt, canConvertToLong, decimalValue, deepCopy, doubleValue, elements, equals, equals, fieldNames, fields, findParent, findParents, findParents, findValue, findValues, findValues, findValuesAsText, findValuesAsText, floatValue, get, get, getNodeType, has, has, hasNonNull, hasNonNull, intValue, isArray, isBigDecimal, isBigInteger, isBinary, isBoolean, isContainerNode, isDouble, isFloat, isFloatingPointNumber, isInt, isIntegralNumber, isLong, isMissingNode, isNull, isNumber, isObject, isPojo, isShort, isTextual, isValueNode, iterator, longValue, numberValue, path, path, shortValue, size, textValue, toString, with, withArray
-
Methods inherited from class com.fasterxml.jackson.databind.JsonSerializable.Base
isEmpty
-
-
-
-
Method Detail
-
findPath
public final JsonNode findPath(java.lang.String fieldName)
Description copied from class:JsonNodeMethod similar toJsonNode.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 whichJsonNode.isMissingNode()returns true; and all value access methods return empty or missing value.
-
hashCode
public abstract int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
traverse
public com.fasterxml.jackson.core.JsonParser traverse()
- Specified by:
traversein interfacecom.fasterxml.jackson.core.TreeNode
-
traverse
public com.fasterxml.jackson.core.JsonParser traverse(com.fasterxml.jackson.core.ObjectCodec codec)
- Specified by:
traversein interfacecom.fasterxml.jackson.core.TreeNode
-
asToken
public abstract com.fasterxml.jackson.core.JsonToken asToken()
Method that can be used for efficient type detection when using stream abstraction for traversing nodes. Will return the firstJsonTokenthat equivalent stream event would produce (for most nodes there is just one token but for structured/container types multiple)- Specified by:
asTokenin interfacecom.fasterxml.jackson.core.TreeNode
-
numberType
public 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.- Specified by:
numberTypein interfacecom.fasterxml.jackson.core.TreeNode
-
serialize
public abstract void serialize(com.fasterxml.jackson.core.JsonGenerator jgen, SerializerProvider provider) throws java.io.IOException, com.fasterxml.jackson.core.JsonProcessingExceptionMethod called to serialize node instances using given generator.- Specified by:
serializein interfaceJsonSerializable- Throws:
java.io.IOExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
serializeWithType
public abstract void serializeWithType(com.fasterxml.jackson.core.JsonGenerator jgen, SerializerProvider provider, TypeSerializer typeSer) throws java.io.IOException, com.fasterxml.jackson.core.JsonProcessingExceptionType information is needed, even if JsonNode instances are "plain" JSON, since they may be mixed with other types.- Specified by:
serializeWithTypein interfaceJsonSerializable- Throws:
java.io.IOExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
-