The TypeFactory in Jackson allows to map directly to collections and other complex types:

String json = "[ \"abc\", \"def\" ]";
ObjectMapper mapper = new ObjectMapper();

List<String> list = mapper.readValue(json, TypeFactory.defaultInstance().constructCollectionType(List.class, String.class));
Answer from Gyorgy Szekely on Stack Overflow
🌐
Makeinjava
makeinjava.com › home › convert list of objects to/from json in java (jackson objectmapper/ example)
Convert list of objects to/from JSON in java (jackson objectmapper/example)
January 1, 2024 - Convert JSON String to List of Person objects in java. package org.learn; import java.io.IOException; import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; public class JSONListConverter { public static void main( String[] args ) throws IOException { ObjectMapper objectMapper = new ObjectMapper(); //Set pretty printing of json objectMapper.enable(SerializationFeature.INDENT_OUTPUT); //Define map which will be converted to JSON List<Person> personList = Stream.of( new Person("Mike", "harvey", 34), new Person("Nick", "young", 75), new Person("Jack", "slater", 21 ), new Person("gary", "hudson", 55)) .collect(Collectors.toList()); //1.
🌐
TutorialsPoint
tutorialspoint.com › article › how-can-we-convert-a-json-array-to-a-list-using-jackson-in-java
How can we convert a JSON array to a list using Jackson in Java?
June 5, 2025 - import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import java.util.List; import java.io.IOException; import java.util.ArrayList; public class JsonArrayToList{ public static void main(String[] args) { String jsonArray = "[{"name":"John","age":30},{"name":"Jane","age":25}]"; ObjectMapper objectMapper = new ObjectMapper(); try { List<Person> personList = objectMapper.readValue(jsonArray, new TypeReference<List<Person>>(){}); for (Person person : personList) { System.out.println("Name: " + person.getName() + ", Age: " + person.getAge()); } }
🌐
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 - import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import java.util.ArrayList; import java.util.List; public class ManualConversionExample { public static void main(String[] args) { String jsonArrayString = "[{\"id\": 1, \"name\": \"John\"}, {\"id\": 2, \"name\": \"Jane\"}]"; ObjectMapper objectMapper = new ObjectMapper(); try { JsonNode jsonArray = objectMapper.readTree(jsonArrayString); List<Person> personList = new ArrayList<>(); for (JsonNode element : jsonArray) { Person person = objectMapper.treeToValue(element, Person.class); personList.a
Find elsewhere
🌐
Baeldung
baeldung.com › home › json › jackson › convert json array to java list
Convert JSON Array to Java List | Baeldung
August 13, 2025 - In the above example, we’ve defined the target type as List<Product>. Then, we use the readValue() method of the ObjectMapper object to convert the JSON array String to a List.
🌐
Jenkov
jenkov.com › tutorials › java-json › jackson-objectmapper.html
Jackson ObjectMapper
Notice how the Car array class is passed as the second parameter to the readValue() method to tell the ObjectMapper that you want to read an array of Car instances. Reading arrays of objects also works with other JSON sources than a string. For instance, a file, URL, InputStream, Reader etc. The Jackson ObjectMapper can also read a Java List of objects from a JSON array string.
🌐
Mkyong
mkyong.com › home › java › how to parse json array with jackson
How to parse JSON Array with Jackson | mkyong.com
April 23, 2024 - package com.mkyong.json.model; public class Person { private String name; private int age; public Person() { } public Person(String name, int age) { this.name = name; this.age = age; } // getters, setters, toString() } In Jackson, we can convert the JSON array to an Array or List. ... package com.mkyong.json.jackson; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import com.mkyong.json.model.Person; import java.util.List; public class JsonArrayToObjectExample { public static void main(String[] args) throws JsonProcessingException { String jsonArray = "[{\"name\":\"mkyong\", \"age\":42}, {\"name\":\"ah pig\", \"age\":20}]"; ObjectMapper mapper = new ObjectMapper(); // 1.
🌐
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 - This is done via the readValue() method, by specifying the JSON contents (String or file) and by specifying the POJO we'd like to map to. # java# json# jackson · Last Updated: September 8th, 2020 · Was this article helpful? Change JSON Field Name with Jackson in Java · Pretty-Printing JSON ...
🌐
GitHub
gist.github.com › Jerrot › fe233a94c5427a4ec29b › 880ba0a531e522fe5fba5884485bed067f629d51
Transform arrays with ObjectMapper to Realm's List type · GitHub
Storing a list of primitive data types in a Realm List apposed to storing a Realm List of Realm Models. I give a possible solution here: https://stackoverflow.com/a/54581186/1486374 ... import RealmSwift import ObjectMapper class ArrayTransform<T: RealmSwift.Object>: TransformType where T: Mappable { typealias Object = List<T> typealias JSON = Array<AnyObject> /** - Parameter value: JSON Value - Returns: if value is `nil` or not Array will be return empty List<T> */ func transformFromJSON(_ value: Any?)
🌐
GitHub
github.com › FasterXML › jackson-databind › issues › 2095
Deserialize list of array failed with enableDefaultTyping · Issue #2095 · FasterXML/jackson-databind
July 23, 2018 - ObjectMapper objectMapper = new ObjectMapper(); objectMapper = objectMapper.enableDefaultTyping(ObjectMapper.DefaultTyping.JAVA_LANG_OBJECT, JsonTypeInfo.As.PROPERTY); List<String[]> list = new ArrayList<>(); list.add(new String[] { "test" }); ...
Author: FasterXML
🌐
Baeldung
baeldung.com › home › json › jackson › intro to the jackson objectmapper
Intro to the Jackson ObjectMapper | Baeldung
December 9, 2025 - The methods writeValueAsString and writeValueAsBytes of ObjectMapper class generate a JSON from a Java object and return the generated JSON as a string or as a byte array:
🌐
Xing's Blog
xinghua24.github.io › Java › ObjectMapper
Introduction to Jackson ObjectMapper | Xing's Blog
March 3, 2024 - If you just juse List.class as the type, you will get a list of LinkedHashMap. and results in a ClassCastException when you try to cast it to List<Item>. When working with polymorphic types, Jackson supports annotations like @JsonTypeInfo and @JsonSubTypes to handle the serialization and deserialization of class hierarchies: Jackson Object Mapper simplifies the complex task of data serialization and deserialization in Java applications. Its flexibility, performance, and extensive features make it an essential tool for developers working with JSON and other data formats.