class JsonUtil {
    private static final Logger logger = LoggerFactory.getLogger(JsonUtil.class);
    // 采用jackson
    private static ObjectMapper mapper = new ObjectMapper();

    /**
     * 将对象转换为json
     * 
     * @param entity
     * @return
     */
    public static String toJson(Object entity) {
        if (entity == null) {
            return null;
        }
        try {
            return mapper.writeValueAsString(entity);
        } catch (IOException e) {
            logger.error("parse entity=" + entity + " to json error!", e);
        }
        return null;
    }

    /**
     * 从json解析出对象
     * 
     * @param <T>
     * @param content
     * @param valueType
     * @return
     */
    public static <T> T fromJson(String content, Class<T> valueType) {<FILL_FUNCTION_BODY>}

    private static ObjectMapper getObjectMapper() {
        return mapper;
    }

    public static ObjectNode createObjectNode() {
        return getObjectMapper().createObjectNode();
    }

    public static ArrayNode createArrayNode() {
        return getObjectMapper().createArrayNode();
    }
}

        if (content == null) {
            return null;
        }
        try {
            return mapper.readValue(content, valueType);
        } catch (IOException e) {
            logger.error("parse content=" + content + " error!", e);
        }
        return null;
    
<no_super_class>