Java Json to Object deserialize(String json, Class clazz)

Here you can find the source of deserialize(String json, Class clazz)

Description

deserialize

License

Open Source License

Declaration

public static <T> T deserialize(String json, Class<T> clazz) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;

public class Main {
    private static final ObjectMapper objectMapper = new ObjectMapper();

    public static <T> T deserialize(String json, Class<T> clazz) {
        try {//from   w ww. j  a  va 2  s  .com
            return objectMapper.readValue(json, clazz);
        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }
    }
}

Related

  1. decode(String input)
  2. decode(String json, Class clazz)
  3. decode(String json, Class clazz)
  4. decodeCommandAsJson(final BsonInput bsonInput)
  5. deserialize(JsonReader reader, Class type)
  6. deserialize(String json, Class targetType)
  7. deserialize(String jsonData, Class typeOfT)
  8. deserializeFromDataNode(JsonParser jp, DeserializationContext ctxt, String propertyName, TypeReference typeReference)
  9. deserializeJson(String content, Class valueType)