这里是我的JSON示例:
JSON
。{
"status": "ok",
"rowCount": 60,
"pageCount": 6,
"value": [{
"CustomerID": 1911,
"CustomerTypeID": 3,
...
}
]
}
我的POJO:
@SerializedName("CustomerID")
public Integer CustomerID;
@SerializedName("CustomerTypeID")
public Integer CustomerTypeID;
我想抓取 value
下的所有内容。
如何使用谷歌的 GSON 实现这一点?
我尝试了通常的方法来处理,但由于明显的原因,它没有起作用:
Type collectionType = new TypeToken<ArrayList<Customer>>() {}.getType();
return gson.fromJson(json, collectionType);