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

CopyObjectMapper 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
🌐
GitHub
github.com › junit-pioneer › junit-pioneer › issues › 654
Convert ArrayNode to List · Issue #654 · junit-pioneer/junit-pioneer
July 28, 2022 - 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 ...
Author   bartsimp
🌐
GitHub
github.com › nasa › astrobee_gds › blob › master › org.codehaus.jackson.json › jackson-src-1.8.5 › src › mapper › java › org › codehaus › jackson › node › ArrayNode.java
astrobee_gds/org.codehaus.jackson.json/jackson-src-1.8.5/src/mapper/java/org/codehaus/jackson/node/ArrayNode.java at master · nasa/astrobee_gds
import java.util.*; · import org.codehaus.jackson.*; import org.codehaus.jackson.map.SerializerProvider; import org.codehaus.jackson.map.TypeSerializer; · /** * Node class that represents Arrays mapped from Json content. */ public final class ArrayNode ·
Author   nasa
🌐
GitHub
github.com › json-path › JsonPath › issues › 678
BUG: cannot use nested expressions while using jackson as provider (Error casting ArrayNode to List) · Issue #678 · json-path/JsonPath
March 22, 2021 - BUG: cannot use nested expressions while using jackson as provider (Error casting ArrayNode to List)#678 ... for example cant read this: "$.books[?(@.author_id in $.authors[?(@.name != "Jasson")]..author_id)]" Using Configuration: JacksonJsonNodeJsonProvider JacksonMappingProvider · java.lang.ClassCastException: class com.fasterxml.jackson.databind.node.ArrayNode cannot be cast to class java.util.List (com.fasterxml.jackson.databind.node.ArrayNode is in unnamed module of loader 'app'; java.util.List is in module java.base of loader 'bootstrap')
Author   roey383
🌐
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.
🌐
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. ... Method that will add a null value at the end of this array node. ... Method for adding specified number at the end of this array. ... Alternative method that we need to avoid bumping into NPE issues with auto-unboxing.
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

CopyObjectMapper 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

Copy{
    "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.

CopyFile 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

🌐
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. ... Method that will add a null value at the end of this array node. ... Method for adding specified number at the end of this array. ... Alternative method that we need to ...
Find elsewhere
🌐
Java Tips
javatips.net › api › org.codehaus.jackson.node.arraynode
Java Examples for org.codehaus.jackson.node.ArrayNode
@Override public Set<String> getImports(JavaClass klass) { final Set<String> imports = new HashSet<String>(); imports.add("org.codehaus.jackson.JsonNode"); imports.add("org.codehaus.jackson.node.ObjectNode"); if (klass.isUsedAsResult()) { imports.add("org.codehaus.jackson.node.ArrayNode"); imports.add("java.util.List"); imports.add("java.util.ArrayList"); } if (klass.isMultiType()) { for (JavaAttribute member : klass.getMembers()) { if (!member.isEnum()) { if ("boolean".equals(member.getType().getName())) { imports.add("org.codehaus.jackson.node.BooleanNode"); } if ("string".equals(member.getT
🌐
GitHub
github.com › modelmapper › modelmapper › issues › 447
Mapping an jackson ArrayNode results in a NullPointerException · Issue #447 · modelmapper/modelmapper
February 27, 2019 - import com.fasterxml.jackson.databind.ObjectMapper; import org.modelmapper.ModelMapper; import org.modelmapper.jackson.ArrayNodeToCollectionConverter; import org.modelmapper.jackson.CollectionToArrayNodeConverter; import org.modelmapper.jackson.JsonNodeValueReader; import org.modelmapper.jackson.PrimitiveJsonNodeConverter; import java.io.IOException; import java.util.List; class Scratch { static class Test { private String stringVal; private List<String> someList; public Test() { } public Test(String stringVal, List<String> someList) { this.stringVal = stringVal; this.someList = someList; } pu
🌐
Fasterxml
fasterxml.github.io › jackson-databind › javadoc › 2.8 › com › fasterxml › jackson › databind › node › ArrayNode.html
ArrayNode (jackson-databind 2.8.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. ... Method that will add a null value at the end of this array node. ... Method for adding specified number at the end of this array. ... Alternative method that we need to avoid bumping into NPE issues with auto-unboxing.
🌐
GitHub
gist.github.com › Cvetomird91 › 054c009e8737bc43c8ba243a59b4cc50
JacksonFilterNodes.java · GitHub
Save Cvetomird91/054c009e8737bc43c8ba243a59b4cc50 to your computer and use it in GitHub Desktop.
🌐
javathinking
javathinking.com › blog › convert-arraynode-to-list-java
Converting ArrayNode to List in Java — javathinking.com
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.
🌐
Baeldung
baeldung.com › home › json › jackson › convert json array to java list
Convert JSON Array to Java List | Baeldung
August 13, 2025 - In this article, we discussed how to convert a JSON array to a Java List using two popular libraries: Gson and Jackson. Gson provides a straightforward approach, whereas Jackson offers advanced features and high performance. The choice of Gson vs. Jackson depends on specific project requirements and preferences. The code backing this article is available on GitHub.
🌐
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 ArrayNode(JsonNodeFactory nf, java.util.List<JsonNode> children) Since: 2.7 · public ArrayNode deepCopy() Description copied from class: JsonNode · 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.
🌐
Fasterxml
fasterxml.github.io › jackson-databind › javadoc › 2.5 › com › fasterxml › jackson › databind › node › ArrayNode.html
ArrayNode (jackson-databind 2.5.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. ... Method that will add a null value at the end of this array node. ... Method for adding specified number at the end of this array. ... Alternative method that we need to avoid bumping into NPE issues with auto-unboxing.
🌐
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. The code backing this article is available on GitHub.
🌐
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 - ArrayNode is a subclass of JsonNode specifically designed to represent JSON arrays. It allows you to work with JSON arrays similarly to how you would work with List in Java.