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

SerializerFeature_DisableCircularReferenceDetect_cn

高铁 edited this page Jul 27, 2016 · 1 revision

在fastjson中,会自动检测循环引用,并且输出为fastjson专有的引用表示格式。但这个不能被其他JSON库识别,也不能被浏览器识别,所以fastjson提供了关闭循环引用检测的功能。使用如下:

import com.alibaba.fastjson.serializer.SerializerFeature;

JSON.toJSONString(obj, SerializerFeature.DisableCircularReferenceDetect);
Clone this wiki locally