将数据结构从java传递给perl(反之亦然) [英] passing a data structure from java to perl (and vice versa)

查看:258
本文介绍了将数据结构从java传递给perl(反之亦然)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几天前,我问过将数据结构从java传递给perl,反之亦然,其中一个recos是JSON。我玩它(主要使用Gson for java),看起来相当不错。唯一的问题是我在我的数据结构中有引用(对于同一数据结构中的其他对象)。目前,每个这样的引用都被完全翻译,所以实际上每个对象都被重复多次,并且你不能告诉所有那些指向同一个对象的引用。

A few days ago I asked about passing a data structure from java to perl and vice versa, and one of the recos was JSON. I played with it (mainly using Gson for java) and it seems quite nice. The only problem is I have references inside my data structure (to other objects inside the same data structure). Currently, each such reference is "translated" fully so actually each object is duplicated many times, and you can't tell all those references pointed to the same object.

是有人将信息从java传递给per,反之亦然,最好是以人类可读的格式,也保留有关引用的数据而不是重复值?

Is there someway to pass info from java to per and vice versa, preferably in a human readable format, that also keeps the data about references instead duplicating values?

推荐答案

与JSON类似的是YAML,YAML允许您描述的内容。我相信Perl有一个YAML解析器,我知道有一个用于Java,因为我在当前应用程序中使用它。

Similar to JSON is "YAML", and YAML allows for exactly what you describe. I believe that there's a YAML parser for Perl and I know there's one for Java because I use it in a current application.

http://yaml.org/

这篇关于将数据结构从java传递给perl(反之亦然)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆