String body="{
"tokens": [
{
"token": "姓名",
"start_offset": 0,
"end_offset": 2,
"type": "CN_WORD",
"position": 0
},
{
"token": "全名",
"start_offset": 0,
"end_offset": 2,
"type": "SYNONYM",
"position": 0
},
{
"token": "真名",
"start_offset": 0,
"end_offset": 2,
"type": "SYNONYM",
"position": 0
},
{
"token": "现名",
"start_offset": 0,
"end_offset": 2,
"type": "SYNONYM",
"position": 0
},
{
"token": "人名",
"start_offset": 0,
"end_offset": 2,
"type": "SYNONYM",
"position": 0
}
]
}";
JSONObject object=JSONObject.parseObject(body);
JSONArray jsonArray = (JSONArray) object.get("tokens");
List<Result> listMap= JSONArray.parseArray(jsonArray.toJSONString(),Result.class);
json字符串转List<entity>
最新推荐文章于 2024-07-27 18:51:22 发布