Yaml and Groovy Add comment to Wiki View in Wiki Edit Wiki page Printable Version

Yaml is a straightforward machine parsable data serialization format designed for human readability and interaction with scripting languages. One of its reasons for popularity is that XML can sometimes be quite verbose and cumbersome. Groovy's XML capabilities make XML less verbose (e.g. through its builder notation for creating XML) and less cumbersome (e.g. its excellent XML processing capabilities). Even so, there may be times when you need to or prefer to use Yaml over XML. Here are some examples of how to use Groovy with the JYaml library.

First, reading simple lists:

Reading maps:

Reading into classes:

Writing lists:

This produces:

- "a, b"
- 123456



Results of your search request can come from various sources: the Groovy website itself, the JIRA issues, the API documentation, as well as a few other interesting Groovy-related blogs.

  By  -  pages  -  views  - last modified