Walter White
Walter White

Reputation:

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

I am using YAML to import data into a db4o database and am wondering how I can structure my documents such 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

Upvotes: 1

Views: 2148

Answers (1)

Andrey
Andrey

Reputation: 3001

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

Upvotes: 2

Related Questions