First create a mapper :

import com.fasterxml.jackson.databind.ObjectMapper;// in play 2.3
ObjectMapper mapper = new ObjectMapper();

As Array:

MyClass[] myObjects = mapper.readValue(json, MyClass[].class);

As List:

List<MyClass> myObjects = mapper.readValue(jsonInput, new TypeReference<List<MyClass>>(){});

Another way to specify the List type:

List<MyClass> myObjects = mapper.readValue(jsonInput, mapper.getTypeFactory().constructCollectionType(List.class, MyClass.class));
Answer from Programmer Bruce on Stack Overflow
🌐
The Jackson List
thejacksonlist.com
The Jackson List – Robert H. Jackson, the Supreme Court, Nuremberg and related topics
Professor John Q. Barrett, who ... periodic “Jackson List” emails about Justice Jackson, the Supreme Court, Nuremberg and related topics to a private but entirely non-selective email list–all are welcome....
🌐
Baeldung
baeldung.com › home › json › jackson › jackson – unmarshall to collection/array
Jackson - Unmarshall to Collection/Array | Baeldung
April 26, 2024 - If you want to dig deeper and learn other cool things you can do with the Jackson 2 – head on over to the main Jackson tutorial. ... @Test public void givenJsonArray_whenDeserializingAsArray_thenCorrect() throws JsonParseException, JsonMappingException, IOException { ObjectMapper mapper = new ObjectMapper(); List<MyDto> listOfDtos = Lists.newArrayList( new MyDto("a", 1, true), new MyDto("bc", 3, false)); String jsonArray = mapper.writeValueAsString(listOfDtos); // [{"stringValue":"a","intValue":1,"booleanValue":true}, // {"stringValue":"bc","intValue":3,"booleanValue":false}] MyDto[] asArray = mapper.readValue(jsonArray, MyDto[].class); assertThat(asArray[0], instanceOf(MyDto.class)); }
🌐
Google Groups
groups.google.com › g › jackson-user › c › oOtEBhoDIgo › m › 8rTqBUgaCwAJ
List with one element
I initialise my JacksonJsonProvider as follows: ObjectMapper mapper = new ObjectMapper(); return new JacksonJsonProvider(mapper); And the list is annotated as follows: @XmlElement(name="users") List<User> users = new ArrayList<>(); What can I do to force JacksonJsonProvider to output a java.util.List always as a list in JSON even when such list has only one element?
🌐
Java Guides
javaguides.net › 2019 › 04 › jackson-list-set-and-map-serialization-and-deseialization-in-java-example.html
Jackson - List, Set and Map Serialization and Deserialization in Java Examples
April 24, 2019 - ObjectMapper mapper = new ObjectMapper(); mapper.enable(SerializationFeature.INDENT_OUTPUT); String json = "[ \"C\", \"C++\", \"Java\", \"Java EE\", \"Python\", \"Scala\", \"JavaScript\" ]"; List < String > progLangs = new ArrayList < > (); progLangs = mapper.readValue(json, List.class); for (Iterator < String > iterator = progLangs.iterator(); iterator.hasNext();) { String progLang = (String) iterator.next(); System.out.println(progLang); } } } ... We can use the ObjectMapper.readValue() method for converting JSON text to Set object. The following example demonstrates how to convert the JSON
🌐
Mkyong
mkyong.com › home › java › how to parse json array with jackson
How to parse JSON Array with Jackson - Mkyong.com
April 23, 2024 - The technique is the same with the above example 4: first converts the JSON string to Map<String, List<Person>> and manually get the List<Person> later. { "Person" : [ { "name" : "mkyong", "age" : 42 }, { "name" : "ah pig", "age" : 20 } ] } ... 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; import java.util.Map; public class JsonArrayToObjectExample4 { public static void main(String[] a
🌐
Medium
cowtowncoder.medium.com › jackson-tips-custom-list-serialization-4566f734c58d
Jackson Tips: custom List serialization | by @cowtowncoder | Medium
May 31, 2021 - Jackson Tips: custom List serialization (how to serialize contents of List in alphabetic order, using “helper” List subtype, custom JsonSerializer) On Customizing Jackson value …
Top answer
1 of 6
104

Something which is much shorter:

mapper.readValue(jsonString, new TypeReference<List<EntryType>>() {});

Where EntryType is a reference to type you would like to hold within collection. It might be any Java class. For example to read JSON representation such as ["a", "b", "c"] second argument to mapper should be new TypeReference<List<String>>() {}

2 of 6
74

If you need to map the incoming json to your List you can do like this

String jsonString = ...; //Your incoming json string
ObjectMapper mapper = new ObjectMapper();
Class<?> clz = Class.forName(yourTypeString);
JavaType type = mapper.getTypeFactory().constructCollectionType(List.class, clz);
List <T> result = mapper.readValue(jsonString, type);

Edit

Something like this, completly untested and never done

public Message<T> deserialize(JsonParser jsonParser, DeserializationContext arg1)
    throws IOException, JsonProcessingException {
    ObjectMapper mapper = new ObjectMapper();
    ObjectCodec oc = jsonParser.getCodec();
    JsonNode node = oc.readTree(jsonParser);

    JsonNode timeStamp = node.get("time");
    Timestamp time = mapper.readValue(timeStamp, Timestamp.class);
    JsonNode restAction = node.get("action");
    RestAction action = mapper.readValue(restAction, RestAction.class);
    String type = node.get("type").getTextValue();
    Class<?> clz = Class.forName(type);
    JsonNode list = node.get("data");
    JavaType listType = mapper.getTypeFactory().constructCollectionType(List.class,   clz);
    List <T> data = mapper.readValue(list, listType);

    Message<T> message = new Message<T>;
    message.setTime(time);
    message.setAction(action);
    message.setType(type);
    message.setData(data);

    return message;
}
Find elsewhere
🌐
John Jay - Historical Society of the New York Courts
history.nycourts.gov › home › blog › the jackson list: miss willard’s english reading list (1910)
The Jackson List: Miss Willard’s English Reading List (1910) - Historical Society of the New York Courts
October 24, 2018 - The Jackson List is a newsletter written by John Q. Barrett (Professor of Law at St. John’s Law School & Elizabeth S. Lenna Fellow at the Robert H. Jackson Center) on the life & career of Supreme Court Justice Robert H. Jackson. We are happy to occasionally reproduce entries from The Jackson List here that touch on New York history and Justice Jackson’s ties to Western New York.
🌐
John Q. Barrett
johnqbarrett.com › tag › jackson-list
Jackson List – John Q. Barrett
An outgrowth of all that is that ... List.” It is a one-way, private email list that reaches many thousands of direct subscribers—teachers, students, scholars, lawyers, Judges, and other learners—and, through their ...
🌐
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 article, we've used Jackson to parse and map the values from a JSON String and file into a Java array and list.
🌐
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 - 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.
🌐
Attacomsian
attacomsian.com › blog › jackson-convert-json-array-to-from-java-list
Convert JSON array to a list using Jackson in Java
November 6, 2022 - try { // create a list of users List<User> users = Arrays.asList( new User("John Doe", "john.doe@example.com", new String[]{"Member", "Admin"}, true), new User("Tom Lee", "tom.lee@example.com", new String[]{"Member"}, false) ); // convert users list to JSON file new ObjectMapper().writeValue(Paths.get("users.json").toFile(), users); } catch (Exception ex) { ex.printStackTrace(); } For more Jackson examples, check out the How to read and write JSON using Jackson in Java tutorial.
🌐
GitHub
github.com › FasterXML › jackson-docs
GitHub - FasterXML/jackson-docs: Documentation for the Jackson JSON processor. · GitHub
Jackson Dev: List for developers of Jackson core components and modules, discussing implementation details, API changes.
Starred by 755 users
Forked by 112 users
🌐
Medium
medium.com › javarevisited › using-the-jackson-library-to-persist-my-javafx-todo-list-to-json-8a4b31917c09
Using the Jackson library to persist my JavaFX ToDo List to JSON | by Donald Raab | Javarevisited | Medium
December 9, 2022 - Using the Jackson library to persist my JavaFX ToDo List to JSON Learn how to use Jackson with Eclipse Collections and Java Date/Time Upgrading my JavaFX ToDoList application In the third iteration …
🌐
GitHub
github.com › FasterXML › jackson-annotations › wiki › Jackson-Annotations
FasterXML/jackson-annotations Wiki
This page lists all general-purpose Jackson 2.0 annotations, grouped by functionality.
Author   FasterXML
🌐
LinkedIn
linkedin.com › in › jackson-list-a04496132
Jackson List - Implementation Consultant - OneTrust
With four years of experience in the compliance software industry, Jackson has built a… · Experience: OneTrust · Education: University of Georgia - Terry College of Business · Location: Boston · 372 connections on LinkedIn. View Jackson List’s profile on LinkedIn, a professional community ...
🌐
Reflectoring
reflectoring.io › jackson
All You Need To Know About JSON Parsing With Jackson
July 15, 2022 - Simple Data Binding which converts JSON to and from Java Maps, Lists, Strings, Numbers, Booleans, and null objects. Full Data Binding which Converts JSON to and from any Java class. ObjectMapper is the most commonly used part of the Jackson library as it’s the easiest way to convert between POJOs and JSON.
🌐
Jenkov
jenkov.com › tutorials › java-json › jackson-objectmapper.html
Jackson ObjectMapper
The Jackson ObjectMapper can also read a Java List of objects from a JSON array string.
🌐
Ranker
ranker.com › home › people › who is the most famous jackson in the world?
Famous Jacksons | List of Famous People Named Jackson
July 15, 2025 - This list is dynamically ranked based on user voting. The order reflects the consensus of our voters and is not influenced by paid placements or editorial bias. ... Jackson Bond was born on April 3, 1996 in Lino Lakes, Minnesota, USA.