Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

泛型嵌套无法解析

walkslowly edited this page Nov 29, 2017 · 1 revision

{ "Data": { "Bar": [], "Line": [ { "Count": 0, "Name": "0-3点" }, { "Count": 0, "Name": "4-7点" }, { "Count": 0, "Name": "8-11点" }, { "Count": 0, "Name": "12-15点" }, { "Count": 0, "Name": "16-19点" }, { "Count": 0, "Name": "20点以后" } ], "MaxCount": 0, "MaxMoney": 0.0, "Pie": { "InMoney": 0.0, "InName": "自有车", "OutMoney": 0.0, "OutName": "外请车" } }, "Msg": "加载成功", "OpCode": 0, "Stat": 1, "Time": 1511943062, "total": 0 }

BaseResult result = JSON.parseObject(json, new TypeReference<BaseResult>() {});

报parentLoader == null && !nullAllowed异常,我用Gson解析可以解析成功.

Clone this wiki locally