Java Json to Object json2pojo(String jsonStr, Class clazz)

Here you can find the source of json2pojo(String jsonStr, Class clazz)

Description

json string convert to javaBean

License

Apache License

Declaration

public static <T> T json2pojo(String jsonStr, Class<T> clazz) throws Exception 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import com.fasterxml.jackson.databind.ObjectMapper;

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

    /**// w  w  w. ja v a  2  s. c om
     * json string convert to javaBean
     */
    public static <T> T json2pojo(String jsonStr, Class<T> clazz) throws Exception {
        return objectMapper.readValue(jsonStr, clazz);
    }
}

Related

  1. deserialize(String jsonData, Class typeOfT)
  2. deserializeFromDataNode(JsonParser jp, DeserializationContext ctxt, String propertyName, TypeReference typeReference)
  3. deserializeJson(String content, Class valueType)
  4. json2List(String json, Class beanClass)
  5. json2map(String jsonStr)
  6. jsonBigDecimal(JsonValue value)
  7. jsonStringToList(String jsonArrStr, Class clazz)
  8. jsonToBeanDateSerializer(String jsonStr, Class cl, final String pattern)
  9. jsonToList(String json, Class parametrized, Class... parameterClasses)