com.fasterxml.jackson.databind.node

## Class BaseJsonNode

- java.lang.Object
- - com.fasterxml.jackson.databind.JsonNode
  - - com.fasterxml.jackson.databind.node.BaseJsonNode

- All Implemented Interfaces:
    TreeNode, JsonSerializable, Iterable<JsonNode>
  Direct Known Subclasses:
    ContainerNode, ValueNode

      public abstract class BaseJsonNode
      extends JsonNode
      implements JsonSerializable

  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.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `BaseJsonNode()`

  - ### Method Summary

    Methods
    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.
    `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.
    `JsonParser.NumberType` | `numberType()` Returns code that identifies type of underlying numeric value, if (and only if) node is a number node.
    `abstract void` | `serialize(JsonGenerator jgen, SerializerProvider provider)` Method called to serialize node instances using given generator.
    `abstract void` | `serializeWithType(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.
    `JsonParser` | `traverse()`
    `JsonParser` | `traverse(ObjectCodec codec)`

    - ### 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, 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 java.lang.Object

      `clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### BaseJsonNode

          protected BaseJsonNode()

  - ### Method Detail

    - #### findPath

          public final JsonNode findPath(String fieldName)

      Description copied from class: `JsonNode`
      Method similar to `JsonNode.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.
      Specified by:
        `findPath` in class `JsonNode`
      Parameters:
        `fieldName` - Name of field to look for
      Returns:
        Value of first matching node found; or if not found, a "missing node" (non-null instance that has no value)

    - #### traverse

          public JsonParser traverse()

      Specified by:
        `traverse` in interface `TreeNode`

    - #### traverse

          public JsonParser traverse(ObjectCodec codec)

      Specified by:
        `traverse` in interface `TreeNode`

    - #### asToken

          public abstract JsonToken asToken()

      Method that can be used for efficient type detection when using stream abstraction for traversing nodes. Will return the first `JsonToken` that equivalent stream event would produce (for most nodes there is just one token but for structured/container types multiple)
      Specified by:
        `asToken` in interface `TreeNode`

    - #### numberType

          public JsonParser.NumberType numberType()

      Returns code that identifies type of underlying numeric value, if (and only if) node is a number node.
      Specified by:
        `numberType` in interface `TreeNode`

    - #### serialize

          public abstract void serialize(JsonGenerator jgen,
                       SerializerProvider provider)
                                  throws IOException,
                                         JsonProcessingException

      Method called to serialize node instances using given generator.
      Specified by:
        `serialize` in interface `JsonSerializable`
      Throws:
        `IOException`
        `JsonProcessingException`

    - #### serializeWithType

          public abstract void serializeWithType(JsonGenerator jgen,
                               SerializerProvider provider,
                               TypeSerializer typeSer)
                                          throws IOException,
                                                 JsonProcessingException

      Type information is needed, even if JsonNode instances are "plain" JSON, since they may be mixed with other types.
      Specified by:
        `serializeWithType` in interface `JsonSerializable`
      Throws:
        `IOException`
        `JsonProcessingException`

Copyright © 2012-2013 FasterXML. All Rights Reserved.