简体   繁体   English

Java相当于Doug Crockford的cycle.js

[英]Java equivalent to Doug Crockford's cycle.js

I'm using JSON as my serialization technology between JavaScript and Java. 我正在使用JSON作为JavaScript和Java之间的序列化技术。 I have an object graph that I want to serialize (not and object tree) and I want to maintain object references when it is serialized/deserialized. 我有一个我要序列化的对象图(不是和对象树),我想在序列化/反序列化时维护对象引用。

Douglas Crockford's cycle.js seems like a good solution for this. Douglas Crockford的cycle.js似乎是一个很好的解决方案。 https://github.com/douglascrockford/JSON-js https://github.com/douglascrockford/JSON-js

But there is no equivalent library on the Java side that I can find. 但是我找不到Java端的等效库。 I'm currently using Gson and would like to use an adapter but so far I can't find one. 我目前正在使用Gson,并希望使用适配器,但到目前为止我找不到一个。

One the Java side there is the Jackson ObjectIdentity feature. Java方面有一个Jackson ObjectIdentity功能。 http://wiki.fasterxml.com/JacksonFeatureObjectIdentity http://wiki.fasterxml.com/JacksonFeatureObjectIdentity

I could switch from Gson to Jackson; 我可以从Gson换到杰克逊; but I can't find an equivalent JavaScript library. 但我找不到一个等效的JavaScript库。

Does anyone know of a Java library that is equivalent to Douglas Crockford's cylce.js? 有谁知道一个相当于Douglas Crockford的cylce.js的Java库? Or a JavaScript library that is equivalent to Jackson ObjectIdentity? 或者是一个等同于Jackson ObjectIdentity的JavaScript库?

我最终使用了支持Java jackson序列化的JSOG ,并且对我来说效果很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM