Here you can find the source of parse(String json, Class
public static <T> T parse(String json, Class<T> tClass)
//package com.java2s; //License from project: Open Source License import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import java.text.SimpleDateFormat; public class Main { private static final ThreadLocal<ObjectMapper> mapper = new ThreadLocal<ObjectMapper>() { @Override/* w w w . j a va 2s . com*/ protected ObjectMapper initialValue() { ObjectMapper objectMapper = new ObjectMapper(); objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); objectMapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY); objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd")); return objectMapper; } }; public static <T> T parse(String json, Class<T> tClass) { try { return mapper.get().readValue(json, tClass); } catch (Exception e) { throw new RuntimeException(e); } } public static <T> T parse(String json, TypeReference<T> typeReference) { try { return mapper.get().readValue(json, typeReference); } catch (Exception e) { throw new RuntimeException(e); } } }