Class YamlParser


public class YamlParser extends XMQParseIntoDOM
Parse (a subset of) yaml into the xmq DOM, a port of the parser in yaml.c. Like the C code, the yaml is translated into calls of the same parse callbacks as the xmq parser uses, so the DOM is built by XMQParseIntoDOM. The input is copied into a char array with a 0 sentinel, lines are 0 terminated when they are read and quoted scalars are decoded in place, exactly like the private buffer of the C parser, so that the scanning code can be kept close to the C code (indexes instead of pointers). Supported: nested mappings, nested sequences, plain, single and double quoted scalars, comments, flow collections, block scalars | and >, anchors (id attribute), aliases (ref attribute) and tags (tag and ltag attributes). All content is text, see yaml.c.
  • Constructor Details

    • YamlParser

      public YamlParser()
      Creates the yaml parser.
  • Method Details

    • parseYaml

      public boolean parseYaml(String input, String source) throws ParseException
      Parse yaml.
      Parameters:
      input - The yaml source.
      source - A description of where the buffer comes from, for error messages.
      Returns:
      True on success.
      Throws:
      ParseException - If the yaml cannot be parsed.