https://xiaoxuzhu.blog.csdn.net/article/details/117305070?spm=1001.2101.3001.6650.1&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1.pc_relevant_default&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1.pc_relevant_default&utm_relevant_index=2
JSONArray 转java对象
List<ErpAluFuturesMarket> list = null; ObjectMapper objm = new ObjectMapper(); JavaType javaType = objm.getTypeFactory().constructParametricType(List.class, ErpAluFuturesMarket.class); try { list = (List<ErpAluFuturesMarket>) objm.readValue(jsonArray.toString(), javaType); logger.info("JSONArray转java List 对象=" + list); } catch (Exception e) { logger.error("JSONArray转java对象出异常!"); e.printStackTrace(); } if (list == null || ArrayUtil.isAllEmpty(list)) { return AjaxResult.error("JSONArray转java对象出异常!"); }