Top Description Fields Constructors Methods
tools.jackson.databind.node

public Class ArrayNode

extends ContainerNode<ArrayNode>
implements ArrayTreeNode, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, tools.jackson.core.tree.ArrayTreeNode, tools.jackson.core.TreeNode
Imports
java.math.BigDecimal, .BigInteger, java.util.*, java.util.function.Predicate, java.util.stream.Stream, tools.jackson.core.*, tools.jackson.core.tree.ArrayTreeNode, tools.jackson.core.type.WritableTypeId, tools.jackson.databind.JsonNode, .SerializationContext, tools.jackson.databind.exc.JsonNodeException, tools.jackson.databind.jsontype.TypeSerializer, tools.jackson.databind.util.RawValue

Node class that represents Arrays mapped from JSON content.

Field Summary

Modifier and TypeField and Description
private final List<JsonNode>
private static final long
Inherited from tools.jackson.databind.node.ContainerNode:
_nodeFactory

Constructor Summary

AccessConstructor and Description
public
public
ArrayNode(JsonNodeFactory nf, int capacity)

public

Method Summary

Modifier and TypeMethod and Description
protected ArrayNode
_add(JsonNode node)

protected JsonNode
_at(JsonPointer ptr)

Implements abstract tools.jackson.databind.JsonNode._at.

Helper method used by other methods for traversing the next step of given path expression, and returning matching value node if any: if no match, null is returned.

protected boolean
protected ArrayNode
_insert(int index, JsonNode node)

protected ArrayNode
_set(int index, JsonNode node)

protected String
_valueDesc()

Implements abstract tools.jackson.databind.node.BaseJsonNode._valueDesc.

Method for implementation classes to return a short description of contained value, to be used in error messages.

protected ArrayNode
_withArray(JsonPointer origPtr, JsonPointer currentPtr, JsonNode.OverwriteMode overwriteMode, boolean preferIndex)

Overrides tools.jackson.databind.node.BaseJsonNode._withArray.

protected ArrayNode
_withArrayAddTailElement(JsonPointer tail, boolean preferIndex)

protected ObjectNode
_withObject(JsonPointer origPtr, JsonPointer currentPtr, JsonNode.OverwriteMode overwriteMode, boolean preferIndex)

Implements abstract tools.jackson.databind.node.ContainerNode._withObject.

protected ObjectNode
_withObjectAddTailElement(JsonPointer tail, boolean preferIndex)

protected void
public ArrayNode

Returns:

This node, to allow chaining
add
(JsonNode value)

Method for adding specified node at the end of this array.

public ArrayNode

Returns:

This array node, to allow chaining
add
(short v)

Method for adding specified number at the end of this array.

public ArrayNode

Returns:

This array node, to allow chaining
add
(Short v)

Alternative method that we need to avoid bumping into NPE issues with auto-unboxing.

public ArrayNode

Returns:

This array node, to allow chaining
add
(int v)

Method for adding specified number at the end of this array.

public ArrayNode

Returns:

This array node, to allow chaining
add
(Integer v)

Alternative method that we need to avoid bumping into NPE issues with auto-unboxing.

public ArrayNode

Returns:

This array node, to allow chaining
add
(long v)

Method for adding specified number at the end of this array.

public ArrayNode

Returns:

This array node, to allow chaining
add
(Long v)

Alternative method that we need to avoid bumping into NPE issues with auto-unboxing.

public ArrayNode

Returns:

This array node, to allow chaining
add
(float v)

Method for adding specified number at the end of this array.

public ArrayNode

Returns:

This array node, to allow chaining
add
(Float v)

Alternative method that we need to avoid bumping into NPE issues with auto-unboxing.

public ArrayNode

Returns:

This array node, to allow chaining
add
(double v)

Method for adding specified number at the end of this array.

public ArrayNode

Returns:

This array node, to allow chaining
add
(Double v)

Alternative method that we need to avoid bumping into NPE issues with auto-unboxing.

public ArrayNode

Returns:

This array node, to allow chaining
add
(BigDecimal v)

Method for adding specified number at the end of this array.

public ArrayNode

Returns:

This array node, to allow chaining
add
(BigInteger v)

Method for adding specified number at the end of this array.

public ArrayNode

Returns:

This array node, to allow chaining
add
(String v)

Method for adding specified String value at the end of this array.

public ArrayNode

Returns:

This array node, to allow chaining
add
(boolean v)

Method for adding specified boolean value at the end of this array.

public ArrayNode

Returns:

This array node, to allow chaining
add
(Boolean v)

Alternative method that we need to avoid bumping into NPE issues with auto-unboxing.

public ArrayNode

Returns:

This array node, to allow chaining
add
(byte[] v)

Method for adding specified binary value at the end of this array (note: when serializing as JSON, will be output Base64 encoded)

public ArrayNode

Returns:

This node (to allow chaining)
addAll
(ArrayNode
Array to add contents from
other
)

Method for adding all child nodes of given Array, appending to child nodes this array contains

public ArrayNode

Returns:

This node (to allow chaining)
addAll
(Collection<? extends JsonNode>
Nodes to add
nodes
)

Method for adding given nodes as child nodes of this array node.

public ArrayNode

Returns:

Newly constructed ArrayNode (NOTE: NOT `this` ArrayNode)
addArray
()

Method that will construct an ArrayNode and add it at the end of this array node.

public ArrayNode

Returns:

This array node, to allow chaining
addNull
()

Method that will add a null value at the end of this array node.

public ObjectNode

Returns:

Newly constructed ObjectNode (NOTE: NOT `this` ArrayNode)
addObject
()

Method that will construct an ObjectNode and add it at the end of this array node.

public ArrayNode

Returns:

This array node, to allow chaining
addPOJO
(Object pojo)

Method that will construct a POJONode and add it at the end of this array node.

public ArrayNode

Returns:

This array node, to allow chaining
addRawValue
(RawValue raw)

public JsonToken
asToken()

Implements abstract tools.jackson.databind.node.ContainerNode.asToken.

Implements tools.jackson.core.TreeNode.asToken.

Method that can be used for efficient type detection when using stream abstraction for traversing nodes.

public ArrayNode
deepCopy()

Implements abstract tools.jackson.databind.JsonNode.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.

public Collection<JsonNode>
elements()

Alias of values().

public boolean
equals(Comparator<JsonNode> comparator, JsonNode o)

Overrides tools.jackson.databind.JsonNode.equals.

Entry method for invoking customizable comparison, using passed-in Comparator object.

public boolean
equals(Object o)

Implements abstract tools.jackson.databind.JsonNode.equals.

Equality for node objects is defined as full (deep) value equality.

public ObjectNode
findParent(String propertyName)

Implements abstract tools.jackson.databind.JsonNode.findParent.

Method for finding a JSON Object that contains specified field, within this node or its descendants.

public List<JsonNode>
findParents(String propertyName, List<JsonNode> foundSoFar)

Implements abstract tools.jackson.databind.JsonNode.findParents.

public JsonNode
findValue(String propertyName)

Implements abstract tools.jackson.databind.JsonNode.findValue.

Method for finding the first JSON Object field with specified name in this node or its child nodes, and returning value it has.

public List<JsonNode>
findValues(String propertyName, List<JsonNode> foundSoFar)

Implements abstract tools.jackson.databind.JsonNode.findValues.

public List<String>
public JsonNode
get(int index)

Implements abstract tools.jackson.databind.node.ContainerNode.get.

Implements tools.jackson.core.TreeNode.get.

Method for accessing value of the specified element of an array node.

public JsonNode
get(String propertyName)

Implements abstract tools.jackson.databind.node.ContainerNode.get.

Implements tools.jackson.core.TreeNode.get.

Method for accessing value of the specified property of an Object node.

public JsonNodeType
getNodeType()

Implements abstract tools.jackson.databind.JsonNode.getNodeType.

Return the type of this node

public int
hashCode()

Implements abstract tools.jackson.databind.node.BaseJsonNode.hashCode.

Returns a hash code value for this object.

public ArrayNode

Returns:

This node (to allow chaining)
insert
(int index, JsonNode value)

Method for inserting specified child node as an element of this Array.

public ArrayNode

Returns:

This array node, to allow chaining
insert
(int index, short v)

Method that will insert specified numeric value at specified position in this array.

public ArrayNode

Returns:

This array node, to allow chaining
insert
(int index, Short value)

Alternative method that we need to avoid bumping into NPE issues with auto-unboxing.

public ArrayNode

Returns:

This array node, to allow chaining
insert
(int index, int v)

Method that will insert specified numeric value at specified position in this array.

public ArrayNode

Returns:

This array node, to allow chaining
insert
(int index, Integer v)

Alternative method that we need to avoid bumping into NPE issues with auto-unboxing.

public ArrayNode

Returns:

This array node, to allow chaining
insert
(int index, long v)

Method that will insert specified numeric value at specified position in this array.

public ArrayNode

Returns:

This array node, to allow chaining
insert
(int index, Long v)

Alternative method that we need to avoid bumping into NPE issues with auto-unboxing.

public ArrayNode

Returns:

This array node, to allow chaining
insert
(int index, float v)

Method that will insert specified numeric value at specified position in this array.

public ArrayNode

Returns:

This array node, to allow chaining
insert
(int index, Float v)

Alternative method that we need to avoid bumping into NPE issues with auto-unboxing.

public ArrayNode

Returns:

This array node, to allow chaining
insert
(int index, double v)

Method that will insert specified numeric value at specified position in this array.

public ArrayNode

Returns:

This array node, to allow chaining
insert
(int index, Double v)

Alternative method that we need to avoid bumping into NPE issues with auto-unboxing.

public ArrayNode

Returns:

This array node, to allow chaining
insert
(int index, BigDecimal v)

Method that will insert specified numeric value at specified position in this array.

public ArrayNode

Returns:

This array node, to allow chaining
insert
(int index, BigInteger v)

Method that will insert specified numeric value at specified position in this array.

public ArrayNode

Returns:

This array node, to allow chaining
insert
(int index, String v)

Method that will insert specified String at specified position in this array.

public ArrayNode

Returns:

This array node, to allow chaining
insert
(int index, boolean v)

Method that will insert specified String at specified position in this array.

public ArrayNode

Returns:

This array node, to allow chaining
insert
(int index, Boolean value)

Alternative method that we need to avoid bumping into NPE issues with auto-unboxing.

public ArrayNode

Returns:

This array node, to allow chaining
insert
(int index, byte[] v)

Method that will insert specified binary value at specified position in this array (note: when written as JSON, will be Base64 encoded)

public ArrayNode

Returns:

Newly constructed ArrayNode (note! NOT `this` ArrayNode)
insertArray
(int index)

Method for creating an array node, inserting it at the specified point in the array, and returning the newly created array (note: NOT 'this' array)

public ArrayNode

Returns:

This array node, to allow chaining
insertNull
(int index)

Method that will insert a null value at specified position in this array.

public ObjectNode

Returns:

Newly constructed ObjectNode (note! NOT `this` ArrayNode)
insertObject
(int index)

Method for creating an ObjectNode, appending it at the end of this array, and returning the newly created node (note: NOT 'this' array)

public ArrayNode

Returns:

This array node, to allow chaining
insertPOJO
(int index, Object pojo)

Method that will construct a POJONode and insert it at specified position in this array.

public ArrayNode

Returns:

This array node, to allow chaining
insertRawValue
(int index, RawValue raw)

public boolean
isArray()

Overrides tools.jackson.databind.JsonNode.isArray.

Implements tools.jackson.core.TreeNode.isArray.

Method that returns true if this node is an Array node, false otherwise.

public boolean
isEmpty(SerializationContext serializers)

Overrides tools.jackson.databind.JacksonSerializable.Base.isEmpty.

Method that may be called on instance to determine if it is considered "empty" for purposes of serialization filtering or not.

public boolean
isEmpty()

Overrides tools.jackson.databind.JsonNode.isEmpty.

Convenience method that is functionally same as:

    size() == 0
public Optional<JsonNode>
optional(int index)

Overrides tools.jackson.databind.JsonNode.optional.

Method for accessing value of the specified element of an array node, wrapped in an Optional.

public JsonNode
path(String propertyName)

Implements abstract tools.jackson.databind.JsonNode.path.

Implements tools.jackson.core.TreeNode.path.

Method for accessing value of the specified property of an Object node.

public JsonNode
path(int index)

Implements abstract tools.jackson.databind.JsonNode.path.

Implements tools.jackson.core.TreeNode.path.

Method for accessing value of the specified element of an array node.

public JsonNode

Returns:

Node removed, if any; null if none
remove
(int index)

Method for removing an entry from this ArrayNode.

public ArrayNode

Returns:

This node (to allow chaining)
removeAll
()

Implements abstract tools.jackson.databind.node.ContainerNode.removeAll.

Method for removing all elements of this array, leaving the array empty.

public ArrayNode
removeIf(Predicate<? super JsonNode> predicate)

Implements abstract tools.jackson.databind.node.ContainerNode.removeIf.

Method for removing matching those children (value) nodes container has that match given predicate.

public JsonNode

Returns:

Old value of the element, if any; null if no such element existed.
replace
(int index, JsonNode
to set element to; if null, will be converted to a NullNode first (to remove field entry, call remove instead)
value
)

Method that will set specified element, replacing old value.

public JsonNode
required(int index)

Overrides tools.jackson.databind.node.BaseJsonNode.required.

Method is functionally equivalent to path(index).required() and can be used to check that this node is an ArrayNode (that is, represents JSON Array value) and has value for specified index (but note that value may be explicit JSON null value).

public void
serialize(JsonGenerator g, SerializationContext provider)

Implements abstract tools.jackson.databind.node.BaseJsonNode.serialize.

Implements tools.jackson.databind.JacksonSerializable.serialize.

Method called to serialize node instances using given generator.

public void
serializeWithType(JsonGenerator g, SerializationContext ctxt, TypeSerializer typeSer)

Implements abstract tools.jackson.databind.node.BaseJsonNode.serializeWithType.

Implements tools.jackson.databind.JacksonSerializable.serializeWithType.

Type information is needed, even if JsonNode instances are "plain" JSON, since they may be mixed with other types.

public ArrayNode

Returns:

This node after adding/replacing property value (to allow chaining)
set
(int index, JsonNode
to set element to; if null, will be converted to a NullNode first (to remove field entry, call remove instead)
value
)

Method that will set specified element, replacing old value.

public ArrayNode

Returns:

This array node (to allow chaining)
set
(int index, short v)

public ArrayNode

Returns:

This node (to allow chaining)
set
(int index, Short v)

Alternative method that we need to avoid bumping into NPE issues with auto-unboxing.

public ArrayNode

Returns:

This node (to allow chaining)
set
(int index, int v)

public ArrayNode

Returns:

This node (to allow chaining)
set
(int index, Integer v)

Alternative method that we need to avoid bumping into NPE issues with auto-unboxing.

public ArrayNode

Returns:

This node (to allow chaining)
set
(int index, long v)

public ArrayNode

Returns:

This node (to allow chaining)
set
(int index, Long v)

public ArrayNode

Returns:

This node (to allow chaining)
set
(int index, float v)

Method for setting value of a field to specified numeric value.

public ArrayNode

Returns:

This node (to allow chaining)
set
(int index, Float v)

Alternative method that we need to avoid bumping into NPE issues with auto-unboxing.

public ArrayNode

Returns:

This node (to allow chaining)
set
(int index, double v)

Method for setting value of a field to specified numeric value.

public ArrayNode

Returns:

This node (to allow chaining)
set
(int index, Double v)

Alternative method that we need to avoid bumping into NPE issues with auto-unboxing.

public ArrayNode

Returns:

This node (to allow chaining)
set
(int index, BigDecimal v)

Method for setting value of a field to specified numeric value.

public ArrayNode

Returns:

This node (to allow chaining)
set
(int index, BigInteger v)

Method for setting value of a field to specified numeric value.

public ArrayNode

Returns:

This node (to allow chaining)
set
(int index, String v)

Method for setting value of a field to specified String value.

public ArrayNode

Returns:

This node (to allow chaining)
set
(int index, boolean v)

Method for setting value of a field to specified String value.

public ArrayNode

Returns:

This node (to allow chaining)
set
(int index, Boolean v)

Alternative method that we need to avoid bumping into NPE issues with auto-unboxing.

public ArrayNode

Returns:

This node (to allow chaining)
set
(int index, byte[] v)

Method for setting value of a field to specified binary value

public ArrayNode

Returns:

This node (to allow chaining)
setNull
(int index)

public ArrayNode

Returns:

This array node, to allow chaining
setPOJO
(int index, Object pojo)

public ArrayNode

Returns:

This array node, to allow chaining
setRawValue
(int index, RawValue raw)

public int
size()

Implements abstract tools.jackson.databind.node.ContainerNode.size.

Implements tools.jackson.core.TreeNode.size.

Method that returns number of child nodes this node contains: for Array nodes, number of child elements, for Object nodes, number of properties, and for all other nodes 0.

public Collection<JsonNode>
values()

Overrides tools.jackson.databind.JsonNode.values.

Method for accessing all value nodes of this Node, iff this node is a JSON Array or Object node.

public Stream<JsonNode>
valueStream()

Implements abstract tools.jackson.databind.node.ContainerNode.valueStream.

Returns a stream of all value nodes of this Node, iff this node is an ArrayNode or ObjectNode.

Inherited from tools.jackson.databind.node.ContainerNode:
arrayNodearrayNodebinaryNodebinaryNodebooleanNodeisContainermissingNodenullNodenumberNodenumberNodenumberNodenumberNodenumberNodenumberNodenumberNodenumberNodenumberNodenumberNodenumberNodenumberNodenumberNodenumberNodeobjectNodepojoNoderawValueNoderemoveNullsstringNode