Search code examples
javaeclipsevariablesconfiguration-filessnakeyaml

Walkthrough of SnakeYAML in Java


I need to read some values and variables from a .yml file and thats it, write them to a String and thats all I need? How would I do this?


Solution

  • Yaml yaml = new Yaml();
    Map<String, Object> config = (Map<String, Object>) yaml.load("Your input");
    

    "Your input" can be InputStream, Reader or String.