Wiki

Clone wiki

snakeyaml-engine / Home

Welcome

YAML 1.2 parser and emitter for the JVM

Requirements

SnakeYAML Engine requires Java 8 or higher.

SnakeYAML Engine does not depend on any external library (but the tests do).

Info

Quick start

Loading (de-serialize):

#!java

 LoadSettings settings = LoadSettings.builder().build();
 Load load = new Load(settings);
 Map<String, Object> map = (Map<String, Object>) load.loadFromString("a: 1\nb: 2\nc:\n  - aaa\n  - bbb");
 System.out.println(obj);

 {b=2, c=[aaa, bbb], a=1}

Example

Dumping (serialise):

#!java

 DumpSettings settings = DumpSettings.builder().build();
 Dump dump = new Dump(settings);
 String output = dump.dumpToString(ImmutableMap.of("x", 1, "y", 2, "z", 3));
 System.out.println(output);


 {x: 1, y: 2, z: 3}

Example

For more details, please check Documentation

Contribute

  • Mercurial DVCS is used to dance with the source code.
  • If you find a bug in SnakeYAML Engine, please file a bug report.
  • You may discuss SnakeYAML Engine at the mailing list.
  • Sonarqube reports can be created locally using docker
#!bash

 docker run --name sonarqube -p 9000:9000 sonarqube

The SnakeYAML Engine library is developed by the team of developers and it is based on PyYAML module written by Kirill Simonov.

SnakeYAML Engine is released under the Apache 2.0 license.

Updated