com.hazelcast.org.snakeyaml.engine.v1.composer

## Class Composer

- java.lang.Object
- - com.hazelcast.org.snakeyaml.engine.v1.composer.Composer

- All Implemented Interfaces:
    Iterator<Node>

      public class Composer
      extends Object
      implements Iterator<Node>

  Creates a node graph from parser events.

  Corresponds to the 'Composer' step as described in chapter 3.1.2 of the YAML Specification.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Parser` | `parser`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Composer(Parser parser, ScalarResolver scalarResolver)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected Node` | `composeKeyNode(MappingNode node)`
    `protected void` | `composeMappingChildren(List<NodeTuple> children, MappingNode node)`
    `protected Node` | `composeMappingNode(Optional<Anchor> anchor)`
    `protected Node` | `composeScalarNode(Optional<Anchor> anchor)`
    `protected Node` | `composeSequenceNode(Optional<Anchor> anchor)`
    `protected Node` | `composeValueNode(MappingNode node)`
    `Optional<Node>` | `getSingleNode()` Reads a document from a source that contains only one document.
    `boolean` | `hasNext()` Checks if further documents are available.
    `Node` | `next()` Reads and composes the next document.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface java.util.Iterator

      `forEachRemaining, remove`

- - ### Field Detail

    - #### parser

          protected final Parser parser

  - ### Constructor Detail

    - #### Composer

          public Composer(Parser parser,
                          ScalarResolver scalarResolver)

  - ### Method Detail

    - #### hasNext

          public boolean hasNext()

      Checks if further documents are available.
      Specified by:
        `hasNext` in interface `Iterator<Node>`
      Returns:
        `true` if there is at least one more document.

    - #### getSingleNode

          public Optional<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 `Optional.empty()` if no document is available.

    - #### next

          public Node next()

      Reads and composes the next document.
      Specified by:
        `next` in interface `Iterator<Node>`
      Returns:
        The root node of the document or `null` if no more documents are available.

    - #### composeScalarNode

          protected Node composeScalarNode(Optional<Anchor> anchor)

    - #### composeSequenceNode

          protected Node composeSequenceNode(Optional<Anchor> anchor)

    - #### composeMappingNode

          protected Node composeMappingNode(Optional<Anchor> anchor)

    - #### composeMappingChildren

          protected void composeMappingChildren(List<NodeTuple> children,
                                                MappingNode node)

    - #### composeKeyNode

          protected Node composeKeyNode(MappingNode node)

    - #### composeValueNode

          protected Node composeValueNode(MappingNode node)

Copyright © 2019. All rights reserved.