jjzjj

applicationCount

全部标签

java - Gson 中的自循环引用

我在反序列化遵循这种格式的Json数组时遇到了一些问题:[{"ChildList":[{"ChildList":[],"Id":110,"Name":"Books","ApplicationCount":0}],"Id":110,"Name":"Books","ApplicationCount":0}]它基本上是一个类别数组,其中每个类别还可以有一个子类别列表,依此类推。我的类模型看起来有点像这样:publicclassArrayOfCategory{protectedListcategory;}publicclassCategory{protectedArrayOfCategoryc