Search in sources :

Example 1 with YamlRepresenter

use of org.bukkit.configuration.file.YamlRepresenter in project BKCommonLib by bergerhealer.

the class ConfigurationNode method toString.

@Override
public String toString() {
    DumperOptions yamlOptions = new DumperOptions();
    YamlRepresenter yamlRepresenter = new YamlRepresenter();
    Yaml yaml = new Yaml(new YamlConstructor(), yamlRepresenter, yamlOptions);
    yamlOptions.setIndent(2);
    yamlOptions.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
    yamlRepresenter.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
    return yaml.dump(source.getValues(false));
}
Also used : DumperOptions(org.yaml.snakeyaml.DumperOptions) YamlRepresenter(org.bukkit.configuration.file.YamlRepresenter) YamlConstructor(org.bukkit.configuration.file.YamlConstructor) Yaml(org.yaml.snakeyaml.Yaml)

Aggregations

YamlConstructor (org.bukkit.configuration.file.YamlConstructor)1 YamlRepresenter (org.bukkit.configuration.file.YamlRepresenter)1 DumperOptions (org.yaml.snakeyaml.DumperOptions)1 Yaml (org.yaml.snakeyaml.Yaml)1