jackson JSON 转对象 JSON 名必须要和对象里面一一对应吗?少不可以吗?
jackson
JSON
转对象
JSON
名必须要和对象里面一一对应吗?少不可以吗?
比如
JSON
是
json
{ "id": 5400, "idstr": "5400", "class": 1, "screen_name": "segmentfault", "name": "segmentfault", "province": "11", "city": "1000", "location": "北京", "description": "", "url": "" }
对象是
java
public class UserInfo { private long id; private String screen_name; ... }
这样就转换不了吗?有什么办法?
想到办法是先转
Map
在设值
toddy
9 years, 8 months ago