封装下jackson的序列号操作
public static String ConvertToJson(Object obj) throws Exception { return mapper.writeValueAsString(obj);}public staticT ConvertToObject(String json, Class valueType) throws Exception { return mapper.readValue(json, valueType);}public static List ConvertToArray(String json, Class valueType) throws Exception { JavaType javaType = mapper.getTypeFactory().constructParametricType(ArrayList.class, valueType); List obj = (List ) mapper.readValue(json, javaType); return obj;}