public class Composer
extends java.lang.Object
Corresponds to the 'Compose' step as described in chapter 3.1 of the YAML Specification.
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,Node> |
anchors |
private CommentEventsCollector |
blockCommentsCollector |
private CommentEventsCollector |
inlineCommentsCollector |
private LoaderOptions |
loadingConfig |
private int |
nestingDepth |
private int |
nestingDepthLimit |
private int |
nonScalarAliasesCount |
protected Parser |
parser |
private java.util.Set<Node> |
recursiveNodes |
private Resolver |
resolver |
Constructor and Description |
---|
Composer(Parser parser,
Resolver resolver) |
Composer(Parser parser,
Resolver resolver,
LoaderOptions loadingConfig) |
Modifier and Type | Method and Description |
---|---|
boolean |
checkNode()
Checks if further documents are available.
|
protected Node |
composeKeyNode(MappingNode node) |
protected void |
composeMappingChildren(java.util.List<NodeTuple> children,
MappingNode node) |
protected Node |
composeMappingNode(java.lang.String anchor) |
private Node |
composeNode(Node parent) |
protected Node |
composeScalarNode(java.lang.String anchor,
java.util.List<CommentLine> blockComments) |
protected Node |
composeSequenceNode(java.lang.String anchor) |
protected Node |
composeValueNode(MappingNode node) |
private void |
decreaseNestingDepth()
Indicate that the collection is finished and the nesting is decreased
|
Node |
getNode()
Reads and composes the next document.
|
Node |
getSingleNode()
Reads a document from a source that contains only one document.
|
private void |
increaseNestingDepth()
Increase nesting depth and fail when it exceeds the denied limit
|
protected final Parser parser
private final Resolver resolver
private final java.util.Map<java.lang.String,Node> anchors
private final java.util.Set<Node> recursiveNodes
private int nonScalarAliasesCount
private final LoaderOptions loadingConfig
private final CommentEventsCollector blockCommentsCollector
private final CommentEventsCollector inlineCommentsCollector
private int nestingDepth
private final int nestingDepthLimit
public Composer(Parser parser, Resolver resolver, LoaderOptions loadingConfig)
public boolean checkNode()
true
if there is at least one more document.public Node getNode()
null
if no more documents are available.public Node getSingleNode()
If the stream contains more than one document an exception is thrown.
null
if no document is available.protected Node composeScalarNode(java.lang.String anchor, java.util.List<CommentLine> blockComments)
protected Node composeSequenceNode(java.lang.String anchor)
protected Node composeMappingNode(java.lang.String anchor)
protected void composeMappingChildren(java.util.List<NodeTuple> children, MappingNode node)
protected Node composeKeyNode(MappingNode node)
protected Node composeValueNode(MappingNode node)
private void increaseNestingDepth()
private void decreaseNestingDepth()