开发者

YAML / SnakeYAML: how refer to the same object multiple times

开发者 https://www.devze.com 2023-01-19 22:27 出处:网络
I am using YAML to import data into a db4o database and am wondering how I can structure my documents su开发者_高级运维ch that when I create an object, I can re-use that same object later on in anothe

I am using YAML to import data into a db4o database and am wondering how I can structure my documents su开发者_高级运维ch that when I create an object, I can re-use that same object later on in another object. For instance, I declare a content type, and then a file after it that uses that content type.

How do I refer to that content type?

Walter


Using YAML you may represent objects of arbitrary graph-like structures. If you want to refer to the same object from different parts of a document, you need to use anchors and aliases

http://code.google.com/p/snakeyaml/wiki/Documentation#Aliases

0

精彩评论

暂无评论...
验证码 换一张
取 消