YAML in one page
YAML - YAML Ain't Markup Language - is an enhancement over simple key-value properties files. Ruby has a module supporting its use and we use it in our test framework test suites for configuration.
A 5 minute intro is here http://yaml.kwiki.org/?YamlInFiveMinutes
A YAML file consists of one or more records, delimited by --- e.g.
--- - me - you - everyone we know
Lists are denoted by - , a dash and a space. So the above record is a list of three elements.
Key value properties are denoted by a : , a colon and a space e.g.
--- url: http://www.zonk.org username: miranda password: july
So the above record is a map with three entries.
Maps and lists can be combined e.g.
--- userOne: - mario - antonioletti userTwo: - amy - krause
This is a map with two entries (keys userOne, userTwo) each of which map to lists with two elements.
Another way of writing the above is using inline lists e.g.:
--- userOne: [mario, antonioletti] userTwo: [amy, krause]
Here is a map of maps:
--- relational: microsoft: sql server ibm: db2 xmldb: exist: exist apache: xindice
And the same, but using inline maps:
---
relational: {microsoft: sql server, ibm: db2}
xmldb: {exist: exist, apache: xindice}
YAML and Java
- JYaml http://jyaml.sourceforge.net/
- 1.3 2007 59K JAR
- BSD-style licence
- Also http://jyaml.sourceforge.net/yaml4spring.html
- YamlBeans http://code.google.com/p/yamlbeans/
- 1.04 01/2009 131K JAR
- New BSD Licence
- Auto serialisation/deserialisation of beans. Recognises public fields and getters.
- SnakeYaml http://code.google.com/p/snakeyaml/
- 1.5 10/2009 222K JAR
- Apache 2.0
- Complete YAML 1.1 parser.
- JVYaml https://jvyaml.dev.java.net/
- 0.2 09/2006 174K JAR
- MIT licence
- YAML 1.1 parser/emitter
