问题描述
类一:public class DriverPointResult{public List<Text> basicInfo;public List<IllegalItem> illegalInfo;public List<IllegalItem> illegalNoPaymentBeforeClearPoint;....get set 方法}类二:public class Text{ private String content;private List<Text> subInfo;private String title;....get set 方法}类三:public class IllegalItem {public Double amount;public String dealTime;public String illegalAction;public String illegalAddress;public int number;public Boolean payed;public String point;....get set 方法}如下相当于json字符串:String resptransport = "[{'basicInfo':[{'content':'content1','subInfo':[{'content':'content11','subInfo':'','title':'title11'},{'content':'content12','subInfo':'','title':'title12'}],'title':'title1'}],'illegalInfo':[{'amount':'amount','dealTime':'dealTime','illegalAction':'illegalAction','illegalAddress':'illegalAddress','number':'number','payed':'payed','point':'point'}],'illegalNoPaymentBeforeClearPoint':[{'amount':'amount','dealTime':'dealTime','illegalAction':'illegalAction','illegalAddress':'illegalAddress','number':'number','payed':'payed','point':'point'}]}]";请求高人相助!!!需要要得到一个DriverPointResult实体类 问题补充:AngelAndAngel 写道
解决方案
json-lib.jarJSONObject json1 = JSONObject.fromString(resptransport);Object bean1 = JSONObject.toBean(json1);然后强制转换成 ··DriverPointResult
解决方案二:
发到你哪里啊
解决方案三:
我这里有个json转化为java对象的包 不知道你要不要。