工具方法:
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;
}

相关文章:

  • 2022-02-07
  • 2022-01-11
  • 2021-12-24
  • 2021-08-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-24
  • 2022-12-23
  • 2022-12-23
  • 2021-12-10
  • 2022-12-23
相关资源
相似解决方案