Java Json to Object deserialize(String jsonData, Class typeOfT)

Here you can find the source of deserialize(String jsonData, Class typeOfT)

Description

deserialize

License

Open Source License

Declaration

public static <T> T deserialize(String jsonData, Class<T> typeOfT) throws IOException 

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 {

    public static <T> T deserialize(String jsonData, Class<T> typeOfT) throws IOException {
        if (jsonData == null) {
            return null;
        }/*  w w w . j  ava  2s .c o m*/
        ObjectMapper mapper = new ObjectMapper();
        return mapper.readValue(jsonData, typeOfT);
    }
}

Related

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