0
我有這樣的JSON格式:解析此JSON格式
["[email protected][id=636,rapidViewId=69,state=CLOSED,name=ABC-1,startDate=2016-07-18T08:22:00.000-04:00,endDate=2016-07-29T04:15:00.000-04:00,completeDate=2016-08-09T10:34:24.009-04:00,sequence=636]", "[email protected][id=656,rapidViewId=69,state=ACTIVE,name=ABC-2,startDate=2016-08-09T10:42:41.342-04:00,endDate=2016-08-19T06:35:00.000-04:00,completeDate=<null>,sequence=656]"]
我試圖分析此使用GSON解析,但得到這個Expected BEGIN_OBJECT but was STRING at line 1 column 3 path $[0]
。
的Java代碼和用於分析一個Spring bean是如下:
Type sprintBeanType = new TypeToken<List<SprintBean>>() {}.getType();
List<SprintBean> sprintBeanList = gson.fromJson(json, sprintBeanType);
public class SprintBean{
@Expose
private String sprint;
public String getSprint() {
return sprint;
}
public void setSprint(String sprint) {
this.sprint = sprint;
}
}
在解析這個JSON任何幫助,高度讚賞。