json字符串

来源:互联网 发布:安卓linux终端 编辑:程序博客网 时间:2024/06/05 20:34

1   string字符串转User对象

String str  =  {"oid":"23gdreds21","fullname":"地点","pid":0,"name":0,"uniquecoding":111}

User user = JSON.parseObject(str, User.class);
2   String字符串转数组

String  str1 = [{"jobids":"","oid":"ff808d0","orderby":33669,"positionids":"","uid":"bbd3"}]

orgs = JSONArray.parseArray(str1, Userorg.class);