Acquire an ObjectReader with ObjectMapper#readerFor(TypeReference) using a TypeReference describing the typed collection you want. Then use ObjectReader#readValue(JsonNode) to parse the JsonNode (presumably an ArrayNode).

For example, to get a List<String> out of a JSON array containing only JSON strings

ObjectMapper mapper = new ObjectMapper();
// example JsonNode
JsonNode arrayNode = mapper.createArrayNode().add("one").add("two");
// acquire reader for the right type
ObjectReader reader = mapper.readerFor(new TypeReference<List<String>>() {
});
// use it
List<String> list = reader.readValue(arrayNode);
Answer from Sotirios Delimanolis on Stack Overflow
🌐
javathinking
javathinking.com › blog › convert-arraynode-to-list-java
Converting ArrayNode to List in Java — javathinking.com
It extends ContainerNode and provides methods to manipulate the array elements, such as adding, removing, and accessing elements. An ArrayNode can hold different types of JSON values like strings, numbers, booleans, and even other JSON objects or arrays. In Java, List is an interface from the Java Collections Framework. It represents an ordered collection of elements that can contain duplicates. Common implementations of the List interface include ArrayList and LinkedList. Converting an ArrayNode to a List allows you to perform operations like sorting, searching, and iteration more easily using Java's built-in collection methods.
🌐
GitHub
github.com › junit-pioneer › junit-pioneer › issues › 654
Convert ArrayNode to List · Issue #654 · junit-pioneer/junit-pioneer
July 28, 2022 - Convert ArrayNode to List#654 · #664 · Copy link · Assignees · Labels · ⚙️ component: PioneerIssues about Pioneer own things (e.g. utils)Issues about Pioneer own things (e.g. utils)🏗️ type: enhancement📖 theme: extensions🚦 status: reviewing · bartsimp · opened · on Jul 28, 2022 · Issue body actions · I'd like to convert a json array into a java List, but I got this error: Error converting parameter at index 0: No implicit conversion to convert object of type com.fasterxml.jackson.databind.node.ArrayNode to type java.util.List org.junit.jupiter.api.extension.ParameterResolutionException: Error converting parameter at index 0: No implicit conversion to convert object of type com.fasterxml.jackson.databind.node.ArrayNode to type java.util.List ·
Author: junit-pioneer
Discussions

java - Jackson Json: how to convert array to JsonNode and ObjectNode? - Stack Overflow
Communities for your favorite technologies. Explore all Collectives · Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work More on stackoverflow.com
🌐 stackoverflow.com
json - Converting Jackson JsonNode array to Java List<String> - Stack Overflow
I hava a Jackson JsonNode (v2.6.3) which has a json array as one of its fields and I'm looking to convert that array to a java List Currently im doing the following problem is line 3: JsonNode More on stackoverflow.com
🌐 stackoverflow.com
json - Converting JsonNode to java array - Stack Overflow
I am working on Play framewrok 2 with websocket and JsonNode . the front end is connected to the play framework backend by use of websocket. I converted a javascript array into a json node and sent... More on stackoverflow.com
🌐 stackoverflow.com
Java Manually convert Array to Node list - Stack Overflow
So I have the following class and am trying to make a method where an array is converted to a node list. I tried a for loop but I can't get it through my mind trying to set the next for each value. More on stackoverflow.com
🌐 stackoverflow.com
April 20, 2016
Top answer
1 of 3
89

Acquire an ObjectReader with ObjectMapper#readerFor(TypeReference) using a TypeReference describing the typed collection you want. Then use ObjectReader#readValue(JsonNode) to parse the JsonNode (presumably an ArrayNode).

For example, to get a List<String> out of a JSON array containing only JSON strings

ObjectMapper mapper = new ObjectMapper();
// example JsonNode
JsonNode arrayNode = mapper.createArrayNode().add("one").add("two");
// acquire reader for the right type
ObjectReader reader = mapper.readerFor(new TypeReference<List<String>>() {
});
// use it
List<String> list = reader.readValue(arrayNode);
2 of 3
13

If an Iterator is more useful...

...you can also use the elements() method of ArrayNode. Example see below.

sample.json

{
    "first": [
        "Some string ...",
        "Some string ..."
    ],
    "second": [
        "Some string ..."
    ]
}

So, the List<String> is inside one of the JsonNodes.

Java

When you convert that inner node to an ArrayNode you can use the elements() method, which returns an Iterator of JsonNodes.

File file = new File("src/test/resources/sample.json");
ObjectMapper mapper = new ObjectMapper();
JsonNode jsonNode = mapper.readTree(file);
ArrayNode arrayNode = (ArrayNode) jsonNode.get("first");
Iterator<JsonNode> itr = arrayNode.elements();
// and to get the string from one of the elements, use for example...
itr.next().asText();

New to Jackson Object Mapper?

I like this tutorial: https://www.baeldung.com/jackson-object-mapper-tutorial

Update:

You can also use .iterator() method of ArrayNode. It is the same:

Same as calling .elements(); implemented so that convenience "for-each" loop can be used for looping over elements of JSON Array constructs.

from the javadocs of com.fasterxml.jackson.core:jackson-databind:2.11.0

🌐
Stack Abuse
stackabuse.com › converting-json-array-to-a-java-array-or-list
Convert JSON Array to a Java Array or List with Jackson
September 8, 2020 - In this tutorial, we'll use Jackson with Java to convert a JSON array into a Java array and a Java List with examples. This can be done from Strings or Files.
🌐
Fasterxml
fasterxml.github.io › jackson-core › javadoc › 1.9 › 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.
Find elsewhere
🌐
Fasterxml
fasterxml.github.io › jackson-databind › javadoc › 2.7 › com › fasterxml › jackson › databind › node › ArrayNode.html
ArrayNode (jackson-databind 2.7.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.
🌐
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?
A JsonNode is a base class for ... JsonNode to ArrayNode by typecasting the ArrayNode to retrieve the values using the readTree() method of ObjectMapper class and get() method for accessing the value of a specified element of an array node....
🌐
Baeldung
baeldung.com › home › json › jackson › convert json array to java list
Convert JSON Array to Java List | Baeldung
August 13, 2025 - We can specify the type of the target List using the TypeToken class. In the above example, we’ve defined the target type as List<Product>. Then, we use the fromJson() method of the Gson object to convert the JSON array String to a List.
🌐
Javadoc.io
javadoc.io › doc › com.fasterxml.jackson.core › jackson-databind › latest › com › fasterxml › jackson › databind › node › ArrayNode.html
ArrayNode - jackson-databind 2.22.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.22.2 · https://javadoc.io/doc/com.fasterxml.jackson.core/jackson-databind/2.22.2 · package-list path (used for javadoc generation ...
🌐
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
🌐
Baeldung
baeldung.com › home › json › jackson › jackson – unmarshall to collection/array
Jackson - Unmarshall to Collection/Array | Baeldung
April 26, 2024 - Mapping JSON arrays to java collections is one of the more common tasks that Jackson is used for, and these solutions are vital to getting to a correct, type-safe mapping.
🌐
Mkyong
mkyong.com › home › java › how to parse json array with jackson
How to parse JSON Array with Jackson | mkyong.com
April 23, 2024 - convert JSON array to Array objects ... System.out.println(p); } // 2. convert JSON array to List List<Person> person2 = mapper.readValue(jsonArray, new TypeReference<>() { }); person2.forEach(System.out::println); } } ... ...
🌐
Apps Developer Blog
appsdeveloperblog.com › home › java › java json › convert json array to java list using jackson
Convert JSON Array to Java List using Jackson - Apps Developer Blog
March 22, 2024 - Converting a JSON array to a list manually involves using Java Jackson’s ObjectMapper class and iterating through the JSON array elements.
🌐
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.)
public java.util.List<JsonNode> findParents(java.lang.String fieldName, java.util.List<JsonNode> foundSoFar) Specified by: findParents in class JsonNode · public JsonNode set(int index, JsonNode value) Method that will set specified field, replacing old value, if any. Parameters: value - to set field to; if null, will be converted to a NullNode first (to remove field entry, call remove(int) instead) Returns: Old value of the field, if any; null if there was no old value. public ArrayNode add(JsonNode value) Method for adding specified node at the end of this array.
🌐
GeeksforGeeks
geeksforgeeks.org › java › program-to-convert-array-to-list-in-java
Java Program to Convert an Array into a List - GeeksforGeeks
July 11, 2025 - If you want to add or remove the elements, you can use the ArrayList constructor to convert an array into a list. The ArrayList constructor can accept a collection, and we can pass a list created from the array.