【问题标题】:Parsing recursive JSON strings with Gson使用 Gson 解析递归 JSON 字符串
【发布时间】:2015-11-04 09:04:17
【问题描述】:

如何使用 Gson 解析 recursive JSON 字符串,如下所示?任何建议将不胜感激,谢谢。

【问题讨论】:

标签: java json gson


【解决方案1】:

你可以在里面使用类

public class City {
    String areaId;
    String areaName;
    // other fields here
    List<City> listCity;
}
...
List<City> data;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-08
    • 1970-01-01
    • 1970-01-01
    • 2020-04-11
    相关资源
    最近更新 更多