jackson Json Parser を使用してこのフィードを解析するのに苦労しています。
フィードは次のとおりです。
{
"responseData": {
"query": "Official Google Blogs",
"entries": [
{
"url": "http://googleblog.blogspot.com/feeds/posts/default",
"title": "<b>Official Blog</b>",
"contentSnippet": "5 days ago <b>...</b> <b>Official</b> weblog, with news of new products, events and glimpses of life inside <br> <b>Google</b>.",
"link": "http://googleblog.blogspot.com/"
},
{
"url": "http://googlewebmastercentral.blogspot.com/feeds/posts/default",
"title": "<b>Official Google</b> Webmaster Central <b>Blog</b>",
"contentSnippet": "Jul 12, 2013 <b>...</b> The <b>official</b> weblog on <b>Google</b> crawling and indexing, and on webmaster tools, <br> including the Sitemaps facility.",
"link": "http://googlewebmastercentral.blogspot.com/"
},
{
"url": "http://googlemac.blogspot.com/feeds/posts/default",
"title": "<b>Official Google</b> Mac <b>Blog</b>",
"contentSnippet": "Jun 22, 2012 <b>...</b> The <b>official</b> weblog about <b>Google</b> in the Apple Macintosh world.",
"link": "http://googlemac.blogspot.com/"
}
]
},
"responseDetails": null,
"responseStatus": 200
}
「エントリ」配列を除くすべてのオブジェクトを逆シリアル化することができました。
何か案が?
私のデータモデルのコードは次のとおりです。
public class UserModel {
public static final String TAG = UserModel.class.getSimpleName()
public static class ResponseData{
private String _query;
public String getQuery(){return _query;}
public void setQuery(String query){_query=query;}
// I am unable to get the entries parsing
}
private String responseStatus;
private String responseDetails;
private ResponseData responseData;
public ResponseData getresponseData() {
return responseData;
}
public void setresponseData(ResponseData responseData) {
this.responseData = responseData;
}
public String getresponseStatus() {
return responseStatus;
}
public void setresponseStatus(String responseStatus) {
this.responseStatus = responseStatus;
}
public String getresponseDetails() {
return responseDetails;
}
public void setresponseDetails(String responseDetails) {
this.responseDetails = responseDetails;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("ResponseStatus [ResponseStatus=");
builder.append(responseStatus);
builder.append(responseData._query);
builder.append("]");
return builder.toString();
}
}