先获取json文件,如下解析即可获取所需字段值,可new对象set值保存或返回。
package UserTest;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
public class JsonTest {
public static void main(String[] args) {
JSONObject json= new JSONObject();
json =JSON.parseObject("{'result':{'AccuracyScore':4.03757,'TotalScore':4.032336,'IsRejected':false,'SSID':'see273db75f@gz282d0c5224303c2a00','FluencyScore':5,'IntegrityScore':5,'AdditionalInfo':{},'ExceptInfo':0,'Sentences':[{'AccuracyScore':4.03757,'TotalScore':4.518785,'Index':0,'FluencyScore':5,'BegPos':0,'EndPos':9420,'Content':'shall we let the cat out of the bag','Words':[{'Index':0,'DpMsg':0,'Score':2.836047,'GlobalIndex':0,'WerrMsg':0,'Content':'shall','PitchBeg':0,'Pitch':'','BegPos':640,'PitchEnd':0,'Property':0,'EndPos':1050,'Sylls':[{'Phones':[{'EndPos':880,'Content':'sh','DpMsg':0,'BegPos':640},{'EndPos':1020,'Content':'ae','DpMsg':0,'BegPos':880},{'EndPos':1050,'Content':'l','DpMsg':0,'BegPos':1020}],'Content':'sh ae l','BegPos':640,'EndPos':1