Class YmlCommentParser

java.lang.Object
dk.lockfuglsang.minecraft.yml.YmlCommentParser

public class YmlCommentParser extends Object
A very simplistic yml parser, that only do the following:
  1. Keep track of indentation-levels and sections.
  2. Handle comments.
  • Constructor Details

    • YmlCommentParser

      public YmlCommentParser()
  • Method Details

    • getCommentMap

      public Map<String,​String> getCommentMap()
    • addComment

      public void addComment(String path, String comment)
    • addComments

      public void addComments(Map<String,​String> comments)
    • getComment

      public String getComment(String path)
    • mergeComments

      public String mergeComments(String ymlPure)
      Merges the comments into the "pure" yml.
      Parameters:
      ymlPure - A YML data-tree, without comments.
      Returns:
      A YML data-tree including comments.
    • load

      public void load(Reader reader) throws IOException
      Throws:
      IOException
    • loadFromString

      public void loadFromString(String contents)