com.fasterxml.jackson.databind

## Class JsonNode

- java.lang.Object
- - com.fasterxml.jackson.databind.JsonSerializable.Base
  - - com.fasterxml.jackson.databind.JsonNode

- All Implemented Interfaces:
    com.fasterxml.jackson.core.TreeNode, JsonSerializable, java.lang.Iterable<JsonNode>
  Direct Known Subclasses:
    BaseJsonNode

      public abstract class JsonNode
      extends JsonSerializable.Base
      implements com.fasterxml.jackson.core.TreeNode, java.lang.Iterable<JsonNode>

  Base class for all JSON nodes, which form the basis of JSON Tree Model that Jackson implements. One way to think of these nodes is to consider them similar to DOM nodes in XML DOM trees.

  As a general design rule, most accessors ("getters") are included in this base class, to allow for traversing structure without type casts. Most mutators, however, need to be accessed through specific sub-classes (such as `ObjectNode` and `ArrayNode`). This seems sensible because proper type information is generally available when building or modifying trees, but less often when reading a tree (newly built from parsed JSON content).

  Actual concrete sub-classes can be found from package `com.fasterxml.jackson.databind.node`.

  Note that it is possible to "read" from nodes, using method `TreeNode.traverse(ObjectCodec)`, which will result in a `JsonParser` being constructed. This can be used for (relatively) efficient conversations between different representations; and it is what core databind uses for methods like `ObjectMapper.treeToValue(TreeNode, Class)` and `ObjectMapper.treeAsTokens(TreeNode)`

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.fasterxml.jackson.databind.JsonSerializable

      `JsonSerializable.Base`

  - ### Constructor Summary

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

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract JsonNode` | `_at(com.fasterxml.jackson.core.JsonPointer ptr)`
    `boolean` | `asBoolean()` Method that will try to convert value of this node to a Java boolean.
    `boolean` | `asBoolean(boolean defaultValue)` Method that will try to convert value of this node to a Java boolean.
    `double` | `asDouble()` Method that will try to convert value of this node to a Java double.
    `double` | `asDouble(double defaultValue)` Method that will try to convert value of this node to a Java double.
    `int` | `asInt()` Method that will try to convert value of this node to a Java int.
    `int` | `asInt(int defaultValue)` Method that will try to convert value of this node to a Java int.
    `long` | `asLong()` Method that will try to convert value of this node to a Java long.
    `long` | `asLong(long defaultValue)` Method that will try to convert value of this node to a Java long.
    `abstract java.lang.String` | `asText()` Method that will return a valid String representation of the container value, if the node is a value node (method `isValueNode()` returns true), otherwise empty String.
    `java.lang.String` | `asText(java.lang.String defaultValue)` Method similar to `asText()`, except that it will return `defaultValue` in cases where null value would be returned; either for missing nodes (trying to access missing property, or element at invalid item for array) or explicit nulls.
    `JsonNode` | `at(com.fasterxml.jackson.core.JsonPointer ptr)` Method for locating node specified by given JSON pointer instances.
    `JsonNode` | `at(java.lang.String jsonPtrExpr)` Convenience method that is functionally equivalent to:
    `java.math.BigInteger` | `bigIntegerValue()`
    `byte[]` | `binaryValue()` Method to use for accessing binary content of binary nodes (nodes for which `isBinary()` returns true); or for Text Nodes (ones for which `textValue()` returns non-null value), to read decoded base64 data.
    `boolean` | `booleanValue()` Method to use for accessing JSON boolean values (value literals 'true' and 'false').
    `boolean` | `canConvertToInt()` Method that can be used to check whether this node is a numeric node (`isNumber()` would return true) AND its value fits within Java's 32-bit signed integer type, `int`.
    `boolean` | `canConvertToLong()` Method that can be used to check whether this node is a numeric node (`isNumber()` would return true) AND its value fits within Java's 64-bit signed integer type, `long`.
    `java.math.BigDecimal` | `decimalValue()`
    `abstract <T extends JsonNode> T` | `deepCopy()` Method that can be called to get a node that is guaranteed not to allow changing of this node through mutators on this node or any of its children.
    `double` | `doubleValue()` Returns 64-bit floating point (double) value for this node, if and only if this node is numeric (`isNumber()` returns true).
    `java.util.Iterator<JsonNode>` | `elements()` Method for accessing all value nodes of this Node, iff this node is a JSON Array or Object node.
    `boolean` | `equals(java.util.Comparator<JsonNode> comparator, JsonNode other)` Entry method for invoking customizable comparison, using passed-in `Comparator` object.
    `abstract boolean` | `equals(java.lang.Object o)` Equality for node objects is defined as full (deep) value equality.
    `java.util.Iterator<java.lang.String>` | `fieldNames()`
    `java.util.Iterator<java.util.Map.Entry<java.lang.String,JsonNode>>` | `fields()`
    `abstract JsonNode` | `findParent(java.lang.String fieldName)` Method for finding a JSON Object that contains specified field, within this node or its descendants.
    `java.util.List<JsonNode>` | `findParents(java.lang.String fieldName)` Method for finding a JSON Object that contains specified field, within this node or its descendants.
    `abstract java.util.List<JsonNode>` | `findParents(java.lang.String fieldName, java.util.List<JsonNode> foundSoFar)`
    `abstract JsonNode` | `findPath(java.lang.String fieldName)` Method similar to `findValue(java.lang.String)`, but that will return a "missing node" instead of null if no field is found.
    `abstract JsonNode` | `findValue(java.lang.String fieldName)` Method for finding a JSON Object field with specified name in this node or its child nodes, and returning value it has.
    `java.util.List<JsonNode>` | `findValues(java.lang.String fieldName)` Method for finding JSON Object fields with specified name, and returning found ones as a List.
    `abstract java.util.List<JsonNode>` | `findValues(java.lang.String fieldName, java.util.List<JsonNode> foundSoFar)`
    `java.util.List<java.lang.String>` | `findValuesAsText(java.lang.String fieldName)` Similar to `findValues(java.lang.String)`, but will additionally convert values into Strings, calling `asText()`.
    `abstract java.util.List<java.lang.String>` | `findValuesAsText(java.lang.String fieldName, java.util.List<java.lang.String> foundSoFar)`
    `float` | `floatValue()` Returns 32-bit floating value for this node, if and only if this node is numeric (`isNumber()` returns true).
    `abstract JsonNode` | `get(int index)` Method for accessing value of the specified element of an array node.
    `JsonNode` | `get(java.lang.String fieldName)` Method for accessing value of the specified field of an object node.
    `abstract JsonNodeType` | `getNodeType()` Return the type of this node
    `boolean` | `has(int index)` Method that allows checking whether this node is JSON Array node and contains a value for specified index If this is the case (including case of specified indexing having null as value), returns true; otherwise returns false.
    `boolean` | `has(java.lang.String fieldName)` Method that allows checking whether this node is JSON Object node and contains value for specified property.
    `boolean` | `hasNonNull(int index)` Method that is similar to `has(int)`, but that will return `false` for explicitly added nulls.
    `boolean` | `hasNonNull(java.lang.String fieldName)` Method that is similar to `has(String)`, but that will return `false` for explicitly added nulls.
    `int` | `intValue()` Returns integer value for this node, if and only if this node is numeric (`isNumber()` returns true).
    `boolean` | `isArray()`
    `boolean` | `isBigDecimal()`
    `boolean` | `isBigInteger()`
    `boolean` | `isBinary()` Method that can be used to check if this node represents binary data (Base64 encoded).
    `boolean` | `isBoolean()` Method that can be used to check if this node was created from JSON boolean value (literals "true" and "false").
    `boolean` | `isContainerNode()`
    `boolean` | `isDouble()`
    `boolean` | `isFloat()`
    `boolean` | `isFloatingPointNumber()`
    `boolean` | `isInt()` Method that can be used to check whether contained value is a number represented as Java `int`.
    `boolean` | `isIntegralNumber()`
    `boolean` | `isLong()` Method that can be used to check whether contained value is a number represented as Java `long`.
    `boolean` | `isMissingNode()`
    `boolean` | `isNull()` Method that can be used to check if this node was created from JSON literal null value.
    `boolean` | `isNumber()`
    `boolean` | `isObject()`
    `boolean` | `isPojo()` Method that can be used to check if the node is a wrapper for a POJO ("Plain Old Java Object" aka "bean".
    `boolean` | `isShort()` Method that can be used to check whether contained value is a number represented as Java `short`.
    `boolean` | `isTextual()` Method that checks whether this node represents basic JSON String value.
    `boolean` | `isValueNode()`
    `java.util.Iterator<JsonNode>` | `iterator()` Same as calling `elements()`; implemented so that convenience "for-each" loop can be used for looping over elements of JSON Array constructs.
    `long` | `longValue()` Returns 64-bit long value for this node, if and only if this node is numeric (`isNumber()` returns true).
    `java.lang.Number` | `numberValue()` Returns numeric value for this node, if and only if this node is numeric (`isNumber()` returns true); otherwise returns null
    `abstract JsonNode` | `path(int index)` This method is similar to `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 `isMissingNode()`) will be returned.
    `abstract JsonNode` | `path(java.lang.String fieldName)` This method is similar to `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 `isMissingNode()`) will be returned.
    `short` | `shortValue()` Returns 16-bit short value for this node, if and only if this node is numeric (`isNumber()` returns true).
    `int` | `size()`
    `java.lang.String` | `textValue()` Method to use for accessing String values.
    `abstract java.lang.String` | `toString()` Method that will produce developer-readable representation of the node; which may or may not be as valid JSON.
    `JsonNode` | `with(java.lang.String propertyName)` Method that can be called on Object nodes, to access a property that has Object value; or if no such property exists, to create, add and return such Object node.
    `JsonNode` | `withArray(java.lang.String propertyName)` Method that can be called on Object nodes, to access a property that has `Array` value; or if no such property exists, to create, add and return such Array node.

    - ### Methods inherited from class com.fasterxml.jackson.databind.JsonSerializable.Base

      `isEmpty`

    - ### Methods inherited from class java.lang.Object

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

    - ### Methods inherited from interface com.fasterxml.jackson.core.TreeNode

      `asToken, numberType, traverse, traverse`

    - ### Methods inherited from interface com.fasterxml.jackson.databind.JsonSerializable

      `serialize, serializeWithType`

- - ### Constructor Detail

    - #### JsonNode

          protected JsonNode()

  - ### Method Detail

    - #### deepCopy

          public abstract <T extends JsonNode> T deepCopy()

      Method that can be called to get a node that is guaranteed not to allow changing of this node through mutators on this node or any of its children. This means it can either make a copy of this node (and all mutable children and grand children nodes), or node itself if it is immutable.

      Note: return type is guaranteed to have same type as the node method is called on; which is why method is declared with local generic type.

      Returns:
        Node that is either a copy of this node (and all non-leaf children); or, for immutable leaf nodes, node itself.
      Since:
        2.0

    - #### size

          public int size()

      Specified by:
        `size` in interface `com.fasterxml.jackson.core.TreeNode`

    - #### isValueNode

          public final boolean isValueNode()

      Specified by:
        `isValueNode` in interface `com.fasterxml.jackson.core.TreeNode`

    - #### isContainerNode

          public final boolean isContainerNode()

      Specified by:
        `isContainerNode` in interface `com.fasterxml.jackson.core.TreeNode`

    - #### isMissingNode

          public final boolean isMissingNode()

      Specified by:
        `isMissingNode` in interface `com.fasterxml.jackson.core.TreeNode`

    - #### isArray

          public final boolean isArray()

      Specified by:
        `isArray` in interface `com.fasterxml.jackson.core.TreeNode`

    - #### isObject

          public final boolean isObject()

      Specified by:
        `isObject` in interface `com.fasterxml.jackson.core.TreeNode`

    - #### get

          public abstract JsonNode get(int index)

      Method for accessing value of the specified element of an array node. For other nodes, null is always returned.

      For array nodes, index specifies exact location within array and allows for efficient iteration over child elements (underlying storage is guaranteed to be efficiently indexable, i.e. has random-access to elements). If index is less than 0, or equal-or-greater than `node.size()`, null is returned; no exception is thrown for any index.

      NOTE: if the element value has been explicitly set as `null` (which is different from removal!), a `NullNode` will be returned, not null.

      Specified by:
        `get` in interface `com.fasterxml.jackson.core.TreeNode`
      Returns:
        Node that represent value of the specified element, if this node is an array and has specified element. Null otherwise.

    - #### get

          public JsonNode get(java.lang.String fieldName)

      Method for accessing value of the specified field of an object node. If this node is not an object (or it does not have a value for specified field name), or if there is no field with such name, null is returned.

      NOTE: if the property value has been explicitly set as `null` (which is different from removal!), a `NullNode` will be returned, not null.

      Specified by:
        `get` in interface `com.fasterxml.jackson.core.TreeNode`
      Returns:
        Node that represent value of the specified field, if this node is an object and has value for the specified field. Null otherwise.

    - #### path

          public abstract JsonNode path(java.lang.String fieldName)

      This method is similar to `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 `isMissingNode()`) will be returned. This allows for convenient and safe chained access via path calls.
      Specified by:
        `path` in interface `com.fasterxml.jackson.core.TreeNode`

    - #### path

          public abstract JsonNode path(int index)

      This method is similar to `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 `isMissingNode()`) will be returned. This allows for convenient and safe chained access via path calls.
      Specified by:
        `path` in interface `com.fasterxml.jackson.core.TreeNode`

    - #### fieldNames

          public java.util.Iterator<java.lang.String> fieldNames()

      Specified by:
        `fieldNames` in interface `com.fasterxml.jackson.core.TreeNode`

    - #### at

          public final JsonNode at(com.fasterxml.jackson.core.JsonPointer ptr)

      Method for locating node specified by given JSON pointer instances. Method will never return null; if no matching node exists, will return a node for which `isMissingNode()` returns true.
      Specified by:
        `at` in interface `com.fasterxml.jackson.core.TreeNode`
      Returns:
        Node that matches given JSON Pointer: if no match exists, will return a node for which `isMissingNode()` returns true.
      Since:
        2.3

    - #### at

          public final JsonNode at(java.lang.String jsonPtrExpr)

      Convenience method that is functionally equivalent to:

             return at(JsonPointer.valueOf(jsonPointerExpression));

      Note that if the same expression is used often, it is preferable to construct `JsonPointer` instance once and reuse it: this method will not perform any caching of compiled expressions.

      Specified by:
        `at` in interface `com.fasterxml.jackson.core.TreeNode`
      Parameters:
        `jsonPtrExpr` - Expression to compile as a `JsonPointer` instance
      Returns:
        Node that matches given JSON Pointer: if no match exists, will return a node for which `TreeNode.isMissingNode()` returns true.
      Since:
        2.3

    - #### _at

          protected abstract JsonNode _at(com.fasterxml.jackson.core.JsonPointer ptr)

    - #### getNodeType

          public abstract JsonNodeType getNodeType()

      Return the type of this node
      Returns:
        the node type as a `JsonNodeType` enum value
      Since:
        2.2

    - #### isPojo

          public final boolean isPojo()

      Method that can be used to check if the node is a wrapper for a POJO ("Plain Old Java Object" aka "bean". Returns true only for instances of `POJONode`.
      Returns:
        True if this node wraps a POJO

    - #### isNumber

          public final boolean isNumber()

      Returns:
        True if this node represents a numeric JSON value

    - #### isIntegralNumber

          public boolean isIntegralNumber()

      Returns:
        True if this node represents an integral (integer) numeric JSON value

    - #### isFloatingPointNumber

          public boolean isFloatingPointNumber()

      Returns:
        True if this node represents a non-integral numeric JSON value

    - #### isShort

          public boolean isShort()

      Method that can be used to check whether contained value is a number represented as Java `short`. Note, however, that even if this method returns false, it is possible that conversion would be possible from other numeric types -- to check if this is possible, use `canConvertToInt()` instead.
      Returns:
        True if the value contained by this node is stored as Java short

    - #### isInt

          public boolean isInt()

      Method that can be used to check whether contained value is a number represented as Java `int`. Note, however, that even if this method returns false, it is possible that conversion would be possible from other numeric types -- to check if this is possible, use `canConvertToInt()` instead.
      Returns:
        True if the value contained by this node is stored as Java int

    - #### isLong

          public boolean isLong()

      Method that can be used to check whether contained value is a number represented as Java `long`. Note, however, that even if this method returns false, it is possible that conversion would be possible from other numeric types -- to check if this is possible, use `canConvertToInt()` instead.
      Returns:
        True if the value contained by this node is stored as Java `long`

    - #### isFloat

          public boolean isFloat()

      Since:
        2.2

    - #### isDouble

          public boolean isDouble()

    - #### isBigDecimal

          public boolean isBigDecimal()

    - #### isBigInteger

          public boolean isBigInteger()

    - #### isTextual

          public final boolean isTextual()

      Method that checks whether this node represents basic JSON String value.

    - #### isBoolean

          public final boolean isBoolean()

      Method that can be used to check if this node was created from JSON boolean value (literals "true" and "false").

    - #### isNull

          public final boolean isNull()

      Method that can be used to check if this node was created from JSON literal null value.

    - #### isBinary

          public final boolean isBinary()

      Method that can be used to check if this node represents binary data (Base64 encoded). Although this will be externally written as JSON String value, `isTextual()` will return false if this method returns true.
      Returns:
        True if this node represents base64 encoded binary data

    - #### canConvertToInt

          public boolean canConvertToInt()

      Method that can be used to check whether this node is a numeric node (`isNumber()` would return true) AND its value fits within Java's 32-bit signed integer type, `int`. Note that floating-point numbers are convertible if the integral part fits without overflow (as per standard Java coercion rules)

      NOTE: this method does not consider possible value type conversion from JSON String into Number; so even if this method returns false, it is possible that `asInt()` could still succeed if node is a JSON String representing integral number, or boolean.

      Since:
        2.0

    - #### canConvertToLong

          public boolean canConvertToLong()

      Method that can be used to check whether this node is a numeric node (`isNumber()` would return true) AND its value fits within Java's 64-bit signed integer type, `long`. Note that floating-point numbers are convertible if the integral part fits without overflow (as per standard Java coercion rules)

      NOTE: this method does not consider possible value type conversion from JSON String into Number; so even if this method returns false, it is possible that `asLong()` could still succeed if node is a JSON String representing integral number, or boolean.

      Since:
        2.0

    - #### textValue

          public java.lang.String textValue()

      Method to use for accessing String values. Does NOT do any conversions for non-String value nodes; for non-String values (ones for which `isTextual()` returns false) null will be returned. For String values, null is never returned (but empty Strings may be)
      Returns:
        Textual value this node contains, iff it is a textual JSON node (comes from JSON String value entry)

    - #### binaryValue

          public byte[] binaryValue()
                             throws java.io.IOException

      Method to use for accessing binary content of binary nodes (nodes for which `isBinary()` returns true); or for Text Nodes (ones for which `textValue()` returns non-null value), to read decoded base64 data. For other types of nodes, returns null.
      Returns:
        Binary data this node contains, iff it is a binary node; null otherwise
      Throws:
        `java.io.IOException`

    - #### booleanValue

          public boolean booleanValue()

      Method to use for accessing JSON boolean values (value literals 'true' and 'false'). For other types, always returns false.
      Returns:
        Textual value this node contains, iff it is a textual json node (comes from JSON String value entry)

    - #### numberValue

          public java.lang.Number numberValue()

      Returns numeric value for this node, if and only if this node is numeric (`isNumber()` returns true); otherwise returns null
      Returns:
        Number value this node contains, if any (null for non-number nodes).

    - #### shortValue

          public short shortValue()

      Returns 16-bit short value for this node, if and only if this node is numeric (`isNumber()` returns true). For other types returns 0. For floating-point numbers, value is truncated using default Java coercion, similar to how cast from double to short operates.
      Returns:
        Short value this node contains, if any; 0 for non-number nodes.

    - #### intValue

          public int intValue()

      Returns integer value for this node, if and only if this node is numeric (`isNumber()` returns true). For other types returns 0. For floating-point numbers, value is truncated using default Java coercion, similar to how cast from double to int operates.
      Returns:
        Integer value this node contains, if any; 0 for non-number nodes.

    - #### longValue

          public long longValue()

      Returns 64-bit long value for this node, if and only if this node is numeric (`isNumber()` returns true). For other types returns 0. For floating-point numbers, value is truncated using default Java coercion, similar to how cast from double to long operates.
      Returns:
        Long value this node contains, if any; 0 for non-number nodes.

    - #### floatValue

          public float floatValue()

      Returns 32-bit floating value for this node, if and only if this node is numeric (`isNumber()` returns true). For other types returns 0.0. For integer values, conversion is done using coercion; this means that an overflow is possible for `long` values
      Returns:
        32-bit float value this node contains, if any; 0.0 for non-number nodes.
      Since:
        2.2

    - #### doubleValue

          public double doubleValue()

      Returns 64-bit floating point (double) value for this node, if and only if this node is numeric (`isNumber()` returns true). For other types returns 0.0. For integer values, conversion is done using coercion; this may result in overflows with `BigInteger` values.
      Returns:
        64-bit double value this node contains, if any; 0.0 for non-number nodes.
      Since:
        2.2

    - #### decimalValue

          public java.math.BigDecimal decimalValue()

    - #### bigIntegerValue

          public java.math.BigInteger bigIntegerValue()

    - #### asText

          public abstract java.lang.String asText()

      Method that will return a valid String representation of the container value, if the node is a value node (method `isValueNode()` returns true), otherwise empty String.

    - #### asText

          public java.lang.String asText(java.lang.String defaultValue)

      Method similar to `asText()`, except that it will return `defaultValue` in cases where null value would be returned; either for missing nodes (trying to access missing property, or element at invalid item for array) or explicit nulls.
      Since:
        2.4

    - #### asInt

          public int asInt()

      Method that will try to convert value of this node to a Java int. Numbers are coerced using default Java rules; booleans convert to 0 (false) and 1 (true), and Strings are parsed using default Java language integer parsing rules.

      If representation can not be converted to an int (including structured types like Objects and Arrays), default value of 0 will be returned; no exceptions are thrown.

    - #### asInt

          public int asInt(int defaultValue)

      Method that will try to convert value of this node to a Java int. Numbers are coerced using default Java rules; booleans convert to 0 (false) and 1 (true), and Strings are parsed using default Java language integer parsing rules.

      If representation can not be converted to an int (including structured types like Objects and Arrays), specified defaultValue will be returned; no exceptions are thrown.

    - #### asLong

          public long asLong()

      Method that will try to convert value of this node to a Java long. Numbers are coerced using default Java rules; booleans convert to 0 (false) and 1 (true), and Strings are parsed using default Java language integer parsing rules.

      If representation can not be converted to an long (including structured types like Objects and Arrays), default value of 0 will be returned; no exceptions are thrown.

    - #### asLong

          public long asLong(long defaultValue)

      Method that will try to convert value of this node to a Java long. Numbers are coerced using default Java rules; booleans convert to 0 (false) and 1 (true), and Strings are parsed using default Java language integer parsing rules.

      If representation can not be converted to an long (including structured types like Objects and Arrays), specified defaultValue will be returned; no exceptions are thrown.

    - #### asDouble

          public double asDouble()

      Method that will try to convert value of this node to a Java double. Numbers are coerced using default Java rules; booleans convert to 0.0 (false) and 1.0 (true), and Strings are parsed using default Java language integer parsing rules.

      If representation can not be converted to an int (including structured types like Objects and Arrays), default value of 0.0 will be returned; no exceptions are thrown.

    - #### asDouble

          public double asDouble(double defaultValue)

      Method that will try to convert value of this node to a Java double. Numbers are coerced using default Java rules; booleans convert to 0.0 (false) and 1.0 (true), and Strings are parsed using default Java language integer parsing rules.

      If representation can not be converted to an int (including structured types like Objects and Arrays), specified defaultValue will be returned; no exceptions are thrown.

    - #### asBoolean

          public boolean asBoolean()

      Method that will try to convert value of this node to a Java boolean. JSON booleans map naturally; integer numbers other than 0 map to true, and 0 maps to false and Strings 'true' and 'false' map to corresponding values.

      If representation can not be converted to a boolean value (including structured types like Objects and Arrays), default value of false will be returned; no exceptions are thrown.

    - #### asBoolean

          public boolean asBoolean(boolean defaultValue)

      Method that will try to convert value of this node to a Java boolean. JSON booleans map naturally; integer numbers other than 0 map to true, and 0 maps to false and Strings 'true' and 'false' map to corresponding values.

      If representation can not be converted to a boolean value (including structured types like Objects and Arrays), specified defaultValue will be returned; no exceptions are thrown.

    - #### has

          public boolean has(java.lang.String fieldName)

      Method that allows checking whether this node is JSON Object node and contains value for specified property. If this is the case (including properties with explicit null values), returns true; otherwise returns false.

      This method is equivalent to:

             node.get(fieldName) != null

      (since return value of get() is node, not value node contains)

      NOTE: when explicit `null` values are added, this method will return `true` for such properties.

      Parameters:
        `fieldName` - Name of element to check
      Returns:
        True if this node is a JSON Object node, and has a property entry with specified name (with any value, including null value)

    - #### has

          public boolean has(int index)

      Method that allows checking whether this node is JSON Array node and contains a value for specified index If this is the case (including case of specified indexing having null as value), returns true; otherwise returns false.

      Note: array element indexes are 0-based.

      This method is equivalent to:

             node.get(index) != null

      NOTE: this method will return `true` for explicitly added null values.

      Parameters:
        `index` - Index to check
      Returns:
        True if this node is a JSON Object node, and has a property entry with specified name (with any value, including null value)

    - #### hasNonNull

          public boolean hasNonNull(java.lang.String fieldName)

      Method that is similar to `has(String)`, but that will return `false` for explicitly added nulls.

      This method is functionally equivalent to:

             node.get(fieldName) != null << !node.get(fieldName).isNull()

      Since:
        2.1

    - #### hasNonNull

          public boolean hasNonNull(int index)

      Method that is similar to `has(int)`, but that will return `false` for explicitly added nulls.

      This method is equivalent to:

             node.get(index) != null << !node.get(index).isNull()

      Since:
        2.1

    - #### iterator

          public final java.util.Iterator<JsonNode> iterator()

      Same as calling `elements()`; implemented so that convenience "for-each" loop can be used for looping over elements of JSON Array constructs.
      Specified by:
        `iterator` in interface `java.lang.Iterable<JsonNode>`

    - #### elements

          public java.util.Iterator<JsonNode> elements()

      Method for accessing all value nodes of this Node, iff this node is a JSON Array or Object node. In case of Object node, field names (keys) are not included, only values. For other types of nodes, returns empty iterator.

    - #### fields

          public java.util.Iterator<java.util.Map.Entry<java.lang.String,JsonNode>> fields()

      Returns:
        Iterator that can be used to traverse all key/value pairs for object nodes; empty iterator (no contents) for other types

    - #### findValue

          public abstract JsonNode findValue(java.lang.String fieldName)

      Method for finding a JSON Object field with specified name in this node or its child nodes, and returning value it has. If no matching field is found in this node or its descendants, returns null.
      Parameters:
        `fieldName` - Name of field to look for
      Returns:
        Value of first matching node found, if any; null if none

    - #### findValues

          public final java.util.List<JsonNode> findValues(java.lang.String fieldName)

      Method for finding JSON Object fields with specified name, and returning found ones as a List. Note that sub-tree search ends if a field is found, so possible children of result nodes are not included. If no matching fields are found in this node or its descendants, returns an empty List.
      Parameters:
        `fieldName` - Name of field to look for

    - #### findValuesAsText

          public final java.util.List<java.lang.String> findValuesAsText(java.lang.String fieldName)

      Similar to `findValues(java.lang.String)`, but will additionally convert values into Strings, calling `asText()`.

    - #### findPath

          public abstract JsonNode findPath(java.lang.String fieldName)

      Method similar to `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 `isMissingNode()` returns true; and all value access methods return empty or missing value.
      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)

    - #### findParent

          public abstract JsonNode findParent(java.lang.String fieldName)

      Method for finding a JSON Object that contains specified field, within this node or its descendants. If no matching field is found in this node or its descendants, returns null.
      Parameters:
        `fieldName` - Name of field to look for
      Returns:
        Value of first matching node found, if any; null if none

    - #### findParents

          public final java.util.List<JsonNode> findParents(java.lang.String fieldName)

      Method for finding a JSON Object that contains specified field, within this node or its descendants. If no matching field is found in this node or its descendants, returns null.
      Parameters:
        `fieldName` - Name of field to look for
      Returns:
        Value of first matching node found, if any; null if none

    - #### findValues

          public abstract java.util.List<JsonNode> findValues(java.lang.String fieldName,
                                            java.util.List<JsonNode> foundSoFar)

    - #### findValuesAsText

          public abstract java.util.List<java.lang.String> findValuesAsText(java.lang.String fieldName,
                                                          java.util.List<java.lang.String> foundSoFar)

    - #### findParents

          public abstract java.util.List<JsonNode> findParents(java.lang.String fieldName,
                                             java.util.List<JsonNode> foundSoFar)

    - #### with

          public JsonNode with(java.lang.String propertyName)

      Method that can be called on Object nodes, to access a property that has Object value; or if no such property exists, to create, add and return such Object node. If the node method is called on is not Object node, or if property exists and has value that is not Object node, `UnsupportedOperationException` is thrown

    - #### withArray

          public JsonNode withArray(java.lang.String propertyName)

      Method that can be called on Object nodes, to access a property that has `Array` value; or if no such property exists, to create, add and return such Array node. If the node method is called on is not Object node, or if property exists and has value that is not Array node, `UnsupportedOperationException` is thrown

    - #### equals

          public boolean equals(java.util.Comparator<JsonNode> comparator,
                       JsonNode other)

      Entry method for invoking customizable comparison, using passed-in `Comparator` object. Nodes will handle traversal of structured types (arrays, objects), but defer to comparator for scalar value comparisons. If a "natural" `Comparator` is passed -- one that simply calls `equals()` on one of arguments, passing the other -- implementation is the same as directly calling `equals()` on node.

      Default implementation simply delegates to passed in `comparator`, with `this` as the first argument, and `other` as the second argument.

      Parameters:
        `comparator` - Object called to compare two scalar `JsonNode` instances, and return either 0 (are equals) or non-zero (not equal)
      Since:
        2.6

    - #### toString

          public abstract java.lang.String toString()

      Method that will produce developer-readable representation of the node; which may or may not be as valid JSON. If you want valid JSON output (or output formatted using one of other Jackson supported data formats) make sure to use `ObjectMapper` or `ObjectWriter` to serialize an instance, for example:

             String json = objectMapper.writeValueAsString(rootNode);

      Note: method defined as abstract to ensure all implementation classes explicitly implement method, instead of relying on `Object.toString()` definition.

      Overrides:
        `toString` in class `java.lang.Object`

    - #### equals

          public abstract boolean equals(java.lang.Object o)

      Equality for node objects is defined as full (deep) value equality. This means that it is possible to compare complete JSON trees for equality by comparing equality of root nodes.

      Note: marked as abstract to ensure all implementation classes define it properly and not rely on definition from `Object`.

      Overrides:
        `equals` in class `java.lang.Object`