参考:
https://blog.****.net/xingfei_work/article/details/76572550 java中四种json解析方式
JSONObject+JSONArray
GSON
FastJSON
jackson
https://blog.****.net/woshimeihuo/article/details/49758645 json的maven依赖包
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version></version>
</dependency>
JSONObject+JSONArray方式:
从字符串中获取json:
JSONObject jobj1=new JSONObject(docuresult);
从json中获取json:
JSONObject jobj2=jobj1.getJSONObject("hits");
从json中获取json array:
JSONArray jarray=jobj2.getJSONArray("hits");
foreach处理json array: