Here you can find the source of deserialize(String json, Class
public static <T> T deserialize(String json, Class<T> targetType)
//package com.java2s; //License from project: Apache License import java.io.IOException; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; public class Main { private static final ObjectMapper objectMapper = new ObjectMapper(); public static <T> T deserialize(String json, Class<T> targetType) { try {// w w w.java2s .c o m return objectMapper.readValue(json, targetType); } catch (IOException e) { throw new IllegalStateException("Failed to convert json to object", e); } } public static <T> T deserialize(String json, JavaType targetType) { try { return objectMapper.readValue(json, targetType); } catch (IOException e) { throw new IllegalStateException("Failed to convert json to object", e); } } }