public class Composer extends Object implements Iterator<org.snakeyaml.engine.v2.nodes.Node>
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.| Constructor and Description |
|---|
Composer(LoadSettings settings,
Parser parser)
Create
|
Composer(Parser parser,
LoadSettings settings)
Deprecated.
use the other constructor with LoadSettings first
|
| Modifier and Type | Method and Description |
|---|---|
protected org.snakeyaml.engine.v2.nodes.Node |
composeKeyNode(org.snakeyaml.engine.v2.nodes.MappingNode node)
To be able to override composeNode(node) which is a key
|
protected void |
composeMappingChildren(List<org.snakeyaml.engine.v2.nodes.NodeTuple> children,
org.snakeyaml.engine.v2.nodes.MappingNode node)
Add the provided Node to the children as the last child
|
protected org.snakeyaml.engine.v2.nodes.Node |
composeMappingNode(Optional<Anchor> anchor)
Create mapping Node
|
protected org.snakeyaml.engine.v2.nodes.Node |
composeScalarNode(Optional<Anchor> anchor,
List<CommentLine> blockComments)
Create ScalarNode
|
protected org.snakeyaml.engine.v2.nodes.SequenceNode |
composeSequenceNode(Optional<Anchor> anchor)
Compose a sequence Node from the input starting with SequenceStartEvent
|
protected org.snakeyaml.engine.v2.nodes.Node |
composeValueNode(org.snakeyaml.engine.v2.nodes.MappingNode node)
To be able to override composeNode(node) which is a value
|
Optional<org.snakeyaml.engine.v2.nodes.Node> |
getSingleNode()
Reads a document from a source that contains only one document.
|
boolean |
hasNext()
Checks if further documents are available.
|
org.snakeyaml.engine.v2.nodes.Node |
next()
Reads and composes the next document.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemaining, removeprotected final Parser parser
@Deprecated public Composer(Parser parser, LoadSettings settings)
parser - - the inputsettings - - configuration optionspublic Composer(LoadSettings settings, Parser parser)
settings - - configuration optionsparser - - the inputpublic boolean hasNext()
public Optional<org.snakeyaml.engine.v2.nodes.Node> getSingleNode()
If the stream contains more than one document an exception is thrown.
Optional.empty() if no document is
available.public org.snakeyaml.engine.v2.nodes.Node next()
protected org.snakeyaml.engine.v2.nodes.Node composeScalarNode(Optional<Anchor> anchor, List<CommentLine> blockComments)
anchor - - anchor if presentblockComments - - comments before the Nodeprotected org.snakeyaml.engine.v2.nodes.SequenceNode composeSequenceNode(Optional<Anchor> anchor)
anchor - - anchor if presentprotected org.snakeyaml.engine.v2.nodes.Node composeMappingNode(Optional<Anchor> anchor)
anchor - - anchor if presentprotected void composeMappingChildren(List<org.snakeyaml.engine.v2.nodes.NodeTuple> children, org.snakeyaml.engine.v2.nodes.MappingNode node)
children - - the list to be extendednode - - the child to the childrenprotected org.snakeyaml.engine.v2.nodes.Node composeKeyNode(org.snakeyaml.engine.v2.nodes.MappingNode node)
node - - the sourceprotected org.snakeyaml.engine.v2.nodes.Node composeValueNode(org.snakeyaml.engine.v2.nodes.MappingNode node)
node - - the sourceCopyright © 2018–2022. All rights reserved.