工具方法:
public static <T> T parseJsonString(String json,Class<T> classType){
ObjectMapper mapper = new ObjectMapper();
T object = null;
try {
object = mapper.readValue(json,classType);
} catch (JsonParseException e) {
logger.error("json解析异常",e);
} catch (JsonMappingException e) {
logger.error("json解析异常",e);
} catch (IOException e) {
logger.error("文件读取异常",e);
}
return object;
}