Class Composer


  • public class Composer
    extends java.lang.Object
    Creates a node graph from parser events.

    Corresponds to the 'Compose' step as described in chapter 3.1 of the YAML Specification.

    • Field Detail

      • parser

        protected final Parser parser
    • Method Detail

      • checkNode

        public boolean checkNode()
        Checks if further documents are available.
        Returns:
        true if there is at least one more document.
      • getNode

        public Node getNode()
        Reads and composes the next document.
        Returns:
        The root node of the document or null if no more documents are available.
      • getSingleNode

        public Node getSingleNode()
        Reads a document from a source that contains only one document.

        If the stream contains more than one document an exception is thrown.

        Returns:
        The root node of the document or null if no document is available.
      • composeScalarNode

        protected Node composeScalarNode​(java.lang.String anchor,
                                         java.util.List<CommentLine> blockComments)
      • composeSequenceNode

        protected Node composeSequenceNode​(java.lang.String anchor,
                                           java.util.List<CommentLine> blockComments)
      • composeMappingNode

        protected Node composeMappingNode​(java.lang.String anchor,
                                          java.util.List<CommentLine> blockComments)
      • composeMappingChildren

        protected void composeMappingChildren​(java.util.List<NodeTuple> children,
                                              MappingNode node,
                                              java.util.List<CommentLine> keyBlockComments)