0
反序列化的子節點應該是什麼我的POJO聲明,如果我想反序列化JSON如下格式:與GSON
{
"id":2,
"content":"skfdjhsfjhsfjkshdkjfhskdjf",
"created_at":"2012-11-14T00:10:59Z",
"feeds":
[
{
"feed":{"name":"twitter"}
}
]
}
目前我的POJO看起來像:
Broadcast.java - 在outtermost對象
public class Broadcast {
private String content;
private String created_at;
private Feeds feed[];
private int id;
public Broadcast() { }
public int getId() { return id; }
public String getContent() { return content; }
public String getCreatedAt() { return created_at; }
}
Feed.java - 廣播的內子,其可以是一個陣列,並且每個進料具有名稱屬性:
public class Feeds {
private String name;
public Feeds() {}
public String getName() {
return name;
}
}
你不需要setter方法,如果你想deserialise? –