Yes, the Jackson manual parser design is quite different from other libraries. In particular, you will notice that JsonNode has most of the functions that you would typically associate with array nodes from other APIs. As such, you do not need to cast to an ArrayNode to use. Here's an example:

JSON:

{
    "objects" : ["One", "Two", "Three"]
}

Code:

final String json = "{\"objects\" : [\"One\", \"Two\", \"Three\"]}";

final JsonNode arrNode = new ObjectMapper().readTree(json).get("objects");
if (arrNode.isArray()) {
    for (final JsonNode objNode : arrNode) {
        System.out.println(objNode);
    }
}

Output:

"One"
"Two"
"Three"

Note the use of isArray to verify that the node is actually an array before iterating. The check is not necessary if you are absolutely confident in your data structure, but it's available should you need it (and this is no different from most other JSON libraries).

Answer from Perception on Stack Overflow
🌐
TutorialsPoint
tutorialspoint.com › how-to-convert-jsonnode-to-arraynode-using-jackson-api-in-java
How to convert JsonNode to ArrayNode using Jackson API in Java?
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.core.JsonProcessingException; public class JSonNodeToArrayNodeTest { public static void main(String args[]) throws JsonProcessingException { String jsonStr = "{\"Technologies\" : [\"Java\", \"Scala\", \"Python\"]}"; ObjectMapper mapper = new ObjectMapper(); ArrayNode arrayNode = (ArrayNode) mapper.readTree(jsonStr).get("Technologies"); if(arrayNode.isArray()) { for(JsonNode jsonNode : arrayNode) { System.out.println(jsonNode); } } } }
🌐
Blogger
javainspires.blogspot.com › home › coding › [jackson api examples] - how to convert jsonnode to arraynode in java?
[Jackson API Examples] - How to convert JsonNode to ArrayNode in Java?
August 15, 2021 - We will OjectMapper class from jackson, readTree() method to convert JSON string to JsonNode. Then we will get the field using get method from JsonNode and check for array type. If the jsonNode is isArray() method return true, we will type cast the JsonNode to ArrayNode...
🌐
YouTube
youtube.com › java inspires
Jackson API:How to convert JsonNode to ArrayNode in Java? | Java Inspires - YouTube
In this video, we will see how to read a array type field from json object means converting JsonNode object to ArrayNode object.https://javainspires.blogspot...
Published   June 1, 2021
Views   3K
🌐
Fasterxml
fasterxml.github.io › jackson-databind › javadoc › 2.6 › com › fasterxml › jackson › databind › node › ArrayNode.html
ArrayNode (jackson-databind 2.6.0 API)
Method that will construct an ArrayNode and add it as a field of this ObjectNode, replacing old value, if any. ... Method that will construct an ObjectNode and add it at the end of this array node. ... Method that will construct a POJONode and add it at the end of this array node.
🌐
Medium
medium.com › @lakshmanaselvan252 › explain-about-the-jsonnode-and-arraynode-in-spring-boot-17f81c3de915
Explain About The JsonNode And ArrayNode In Spring Boot | by Lakshmana Selvan V | Medium
August 21, 2024 - Explain About The JsonNode And ArrayNode In Spring Boot In Spring Boot, working with JSON data is a common task, especially when dealing with APIs. The JsonNode and ArrayNode classes, provided by the …
🌐
Javadoc.io
javadoc.io › doc › com.fasterxml.jackson.core › jackson-databind › latest › com › fasterxml › jackson › databind › node › ArrayNode.html
ArrayNode - jackson-databind 2.21.2 javadoc
Bookmarks · Latest version of com.fasterxml.jackson.core:jackson-databind · https://javadoc.io/doc/com.fasterxml.jackson.core/jackson-databind · Current version 2.21.2 · https://javadoc.io/doc/com.fasterxml.jackson.core/jackson-databind/2.21.2 · package-list path (used for javadoc generation ...
🌐
Java Code Geeks
javacodegeeks.com › home › enterprise java
Simplified Json Array Operations with JsonNode in Jackson
May 6, 2024 - When working with JSON arrays ([]), the ArrayNode class in Jackson is especially useful for handling Simplified Array Operations on JsonNode in Jackson, enabling efficient manipulation and traversal of JSON arrays within Java applications.
Find elsewhere
🌐
Adobe Developer
developer.adobe.com › experience-manager › reference-materials › cloud-service › javadoc › com › fasterxml › jackson › databind › node › ArrayNode.html
ArrayNode (The Adobe Experience Manager SDK 2022.11.9850.20221116T162329Z-220900)
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. ... Node that represent value of the specified element, if this node is an array and has specified element. Null otherwise. public JsonNode get​(java.lang.String fieldName)
🌐
Adobe Developer
developer.adobe.com › experience-manager › reference-materials › 6-5 › javadoc › com › fasterxml › jackson › databind › node › ArrayNode.html
ArrayNode (The Adobe AEM Quickstart and Web Application.)
... Node that represent value of the specified element, if this node is an array and has specified element; otherwise "missing node" is returned. ... Method is functionally equivalent to path(index).required() and can be used to check that this node is an ArrayNode (that is, represents JSON ...
🌐
DEV Community
dev.to › abharangupta › dive-into-jackson-for-json-in-java-understanding-jsonnode-arraynode-and-objectmapper-30g4
Dive into Jackson for JSON in Java: Understanding JsonNode, ArrayNode, and ObjectMapper - DEV Community
October 22, 2024 - ArrayNode is a special type of JsonNode that represents an array of JSON objects. We loop through each element in the array and print out the "name" of each person. Easy, right? With ArrayNode, Jackson makes handling JSON arrays a breeze!
🌐
Javadoc.io
javadoc.io › static › org.codehaus.jackson › jackson-core-lgpl › 1.9.13 › org › codehaus › jackson › node › ArrayNode.html
ArrayNode (Jackson JSON Processor)
Method that will construct an ArrayNode and add it as a field of this ObjectNode, replacing old value, if any. ... Method that will construct an ObjectNode and add it at the end of this array node. ... Method that will construct a POJONode and add it at the end of this array node.
🌐
GitHub
github.com › FasterXML › jackson-dataformat-xml › issues › 403
Make `JsonNode` implicitly create `ArrayNode`s for repeated XML Elements · Issue #403 · FasterXML/jackson-dataformat-xml
May 21, 2020 - It should be easy enough to make JsonNodeDeserializer have logic of "auto-converting" value nodes into ArrayNodes, in case of "duplicates", however; and as long as this is guarded with something (for example, new StreamReadCapability.DUPLICATE_PROPERTIES), it should be completely safe and not change regular JSON processing accidentally.
Published   May 21, 2020
Author   cowtowncoder
🌐
Baeldung
baeldung.com › home › json › jackson › working with tree model nodes in jackson
Working with Tree Model Nodes in Jackson | Baeldung
January 8, 2024 - We simply call the asText method ... item within the Array node is itself a JsonNode, so we iterate over the Array and pass each node to the appendNodeToYaml method....
🌐
Fasterxml
fasterxml.github.io › jackson-databind › javadoc › 2.8 › com › fasterxml › jackson › databind › node › ArrayNode.html
ArrayNode (jackson-databind 2.8.0 API)
get in class ContainerNode<ArrayNode> Returns: Node that represent value of the specified field, if this node is an object and has value for the specified field. Null otherwise. public JsonNode path(String fieldName) Description copied from class: JsonNode · This method is similar to JsonNode.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 JsonNode.isMissingNode()) will be returned.