我必须完成另一个程序员的项目,他从杰克逊注释和 REST apis 开始。我没有这方面的经验,现在挣扎了几个小时。我需要像这样解析 json 数组:
{
...
"id_s": "3011",
"no_s": "Suteki",
"fl": [
{
"v": "1",
"m": "0",
"id_fs": "243",
"f_c": "2013-08-09 14:43:54",
id_tf": "3",
"u_c": "Aaa",
_u_c": "1347678779",
"c": "Carlos Rojas",
"c_c": "1"
}
]
}
现有的类是这样的:
@EBean
@JsonIgnoreProperties(ignoreUnknown = true)
public class Item implements Serializable, MapMarker {
private static final long serialVersionUID = 1L;
@JsonProperty("id_s")
protected int id;
@JsonProperty("id_sucursal")
public void setId_sucursal(int id_sucursal) {
this.id = id_sucursal;
}
@JsonProperty("id_fb")
protected String idFacebook;
@JsonProperty("no_s")
private String name;
...
}
我在这里阅读了如何解析数组,但是如何使用 Jackson 注释获取jsonResponseString ?我想念什么?
谢谢!