码迷,mamicode.com
首页 > Web开发 > 详细

JSON解析关联类型发生死循环 There is a cycle in the hierarchy!

时间:2015-04-08 23:00:41      阅读:163      评论:0      收藏:0      [点我收藏+]

标签:

解决办法是忽略掉关联类型的数据,使用jsonConfig进行配置,代码如下:

JsonConfig jsonConfig = new JsonConfig();  //建立配置文件

jsonConfig.setIgnoreDefaultExcludes(false);  //设置默认忽略

jsonConfig.setExcludes(new String[]{"glLocation"}); 

JSONArray jsonArray = JSONArray.fromObject(list,jsonConfig);  //加载配置文件

JSON解析关联类型发生死循环 There is a cycle in the hierarchy!

标签:

原文地址:http://www.cnblogs.com/zhengcong/p/4404333.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!