Search in sources :

Example 1 with SkipNullRepresenter

use of org.getopentest.serialization.yaml.SkipNullRepresenter in project opentest by mcdcorp.

the class Factory method getYaml.

/**
 * Returns a YAML parser object pre-configured with some defaults.
 */
public static Yaml getYaml() {
    final DumperOptions options = new DumperOptions();
    options.setDefaultFlowStyle(DumperOptions.FlowStyle.FLOW);
    options.setPrettyFlow(true);
    SkipNullRepresenter representer = new SkipNullRepresenter();
    representer.addClassTag(TestDefAction.class, Tag.MAP);
    return new Yaml(representer, options);
}
Also used : SkipNullRepresenter(org.getopentest.serialization.yaml.SkipNullRepresenter) DumperOptions(org.yaml.snakeyaml.DumperOptions) Yaml(org.yaml.snakeyaml.Yaml)

Aggregations

SkipNullRepresenter (org.getopentest.serialization.yaml.SkipNullRepresenter)1 DumperOptions (org.yaml.snakeyaml.DumperOptions)1 Yaml (org.yaml.snakeyaml.Yaml)1