Here you can find the source of jsonToList(String jsonStr, TypeReference
public static <T> T jsonToList(String jsonStr, TypeReference<T> valueTypeRef)
//package com.java2s; //License from project: Apache License import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; public class Main { public static <T> T jsonToList(String jsonStr, TypeReference<T> valueTypeRef) { ObjectMapper mapper = new ObjectMapper(); try {// ww w. j a v a2 s. c o m return mapper.readValue(jsonStr, valueTypeRef); } catch (Exception e) { e.printStackTrace(); } return null; } }