Class CommentsReader


  • public final class CommentsReader
    extends java.lang.Object
    Custom yaml parser, preserving comments. Everything above property assumed to be it's comment. Possible free comment at the end of file is parsed as special comment-only node.

    Parser works by line. For values, it does not parse exact value, instead remembers entire line to aggregate possible in-line comments. Multi-line values are explicitly supported (but, also, all lines in multi line value remembered completely to exactly reproduce original structure).

    Parser assumed to be used on valid yaml file only (and so snakeyaml must be used first to validate file).

    Since:
    22.04.2021
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static CmtTree read​(java.io.File yaml)  
      static CmtTree read​(java.lang.String yaml)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • read

        public static CmtTree read​(java.io.File yaml)
        Parameters:
        yaml - yaml file
        Returns:
        parsed yaml model tree
      • read

        public static CmtTree read​(java.lang.String yaml)
        Parameters:
        yaml - yaml string
        Returns:
        parsed yaml model tree