Corresponds to the 'Composer' step as described in chapter 3.1.2 of the YAML Specification.
It implementsIterator to get the stream of Nodes from the input.
| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| private final CommentEventsCollector | |
| private final CommentEventsCollector | |
| private final MergeUtils | |
| private int | |
| protected final Parser | parser
Event parser |
| private final Set | |
| private final ScalarResolver | |
| private final LoadSettings |
| Access | Constructor and Description |
|---|---|
| public | Composer(Parser
- the input parser, LoadSettings - configuration options settings)
Deprecated
use the other constructor with LoadSettings first
|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected MappingNode | |
| protected Node | Returns: node- the source node)To be able to override composeNode(node) which is a key |
| protected void | composeMappingChildren(List<NodeTuple>
- the list to be extended children, MappingNode - the child to the children node)Add the provided Node to the children as the last child |
| protected Node | |
| private Node | |
| protected Node | Returns: Node- anchor if present anchor, List<CommentLine> - comments before the Node blockComments)Create ScalarNode |
| protected SequenceNode | Returns: parsed Node- anchor if present anchor)Compose a sequence Node from the input starting with SequenceStartEvent |
| protected Node | Returns: node- the source node)To be able to override composeNode(node) which is a value |
| public Optional | Returns: The root node of the document orOptional.empty() if no document is
available.Reads a document from a source that contains only one document. |
| public boolean | Returns: true if there is at least one more document.Implements java. Checks if further documents are available. |
| public Node | Returns: The root node of the document ornull if no more documents are available.Implements java. Reads and composes the next document. |
| private void |
| anchors | back to summary |
|---|---|
| private final Map<Anchor, Node> anchors | |
| blockCommentsCollector | back to summary |
|---|---|
| private final CommentEventsCollector blockCommentsCollector | |
| inlineCommentsCollector | back to summary |
|---|---|
| private final CommentEventsCollector inlineCommentsCollector | |
| mergeUtils | back to summary |
|---|---|
| private final MergeUtils mergeUtils | |
| nonScalarAliasesCount | back to summary |
|---|---|
| private int nonScalarAliasesCount | |
| parser | back to summary |
|---|---|
| protected final Parser parser Event parser | |
| recursiveNodes | back to summary |
|---|---|
| private final Set<Node> recursiveNodes | |
| scalarResolver | back to summary |
|---|---|
| private final ScalarResolver scalarResolver | |
| settings | back to summary |
|---|---|
| private final LoadSettings settings | |
| Composer | back to summary |
|---|---|
| public Composer(Parser parser, LoadSettings settings)
Deprecated use the other constructor with LoadSettings first
| |
| Composer | back to summary |
|---|---|
| public Composer(LoadSettings settings, Parser parser) Create
| |
| asMappingNode | back to summary |
|---|---|
| protected MappingNode asMappingNode(Node node) | |
| composeKeyNode | back to summary |
|---|---|
| protected Node composeKeyNode(MappingNode node) To be able to override composeNode(node) which is a key
| |
| composeMappingChildren | back to summary |
|---|---|
| protected void composeMappingChildren(List<NodeTuple> children, MappingNode node) Add the provided Node to the children as the last child
| |
| composeMappingNode | back to summary |
|---|---|
| protected Node composeMappingNode(Optional<Anchor> anchor) Create mapping Node | |
| composeNode | back to summary |
|---|---|
| private Node composeNode(Optional<Node> parent) | |
| composeScalarNode | back to summary |
|---|---|
| protected Node composeScalarNode(Optional<Anchor> anchor, List<CommentLine> blockComments) Create ScalarNode
| |
| composeSequenceNode | back to summary |
|---|---|
| protected SequenceNode composeSequenceNode(Optional<Anchor> anchor) Compose a sequence Node from the input starting with SequenceStartEvent
| |
| composeValueNode | back to summary |
|---|---|
| protected Node composeValueNode(MappingNode node) To be able to override composeNode(node) which is a value
| |
| getSingleNode | back to summary |
|---|---|
| public Optional Reads a document from a source that contains only one document. If the stream contains more than one document an exception is thrown. | |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Checks if further documents are available.
| |
| next | back to summary |
|---|---|
| public Node next() Implements java. Reads and composes the next document.
| |
| registerAnchor | back to summary |
|---|---|
| private void registerAnchor(Anchor anchor, Node node) | |