Here you can find the source of json2Obj(String json, Class
public static <T> T json2Obj(String json, Class<T> clazz)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import com.fasterxml.jackson.databind.ObjectMapper; public class Main { public static <T> T json2Obj(String json, Class<T> clazz) { ObjectMapper objectMapper = new ObjectMapper(); try {//from www. j av a 2 s .com objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")); return objectMapper.readValue(json, clazz); } catch (Exception e) { e.printStackTrace(); return null; } } }