public abstract class Node extends Object
The nodes form the node-graph described in the YAML Specification.
While loading, the node graph is usually created by the
Composer
, and later transformed into
application specific Java classes by the classes from the
org.yaml.snakeyaml.constructor
package.
Modifier and Type | Field and Description |
---|---|
protected Mark |
endMark |
protected boolean |
resolved
true when the tag is assigned by the resolver
|
protected Boolean |
useClassConstructor |
Constructor and Description |
---|
Node(Tag tag,
Mark startMark,
Mark endMark) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Node is only equal to itself
|
String |
getAnchor() |
List<CommentLine> |
getBlockComments()
The ordered list of blank lines and block comments (full line) that appear before this node.
|
List<CommentLine> |
getEndComments()
The ordered list of blank lines and block comments (full line) that appear AFTER this node.
|
Mark |
getEndMark() |
List<CommentLine> |
getInLineComments()
The ordered list of in-line comments.
|
abstract NodeId |
getNodeId()
For error reporting.
|
Mark |
getStartMark() |
Tag |
getTag()
Tag of this node.
|
Class<? extends Object> |
getType() |
int |
hashCode() |
boolean |
isResolved()
Deprecated.
Since v1.22. Absent in immediately prior versions, but present previously. Restored deprecated for backwards compatibility.
|
boolean |
isTwoStepsConstruction()
Indicates if this node must be constructed in two steps.
|
void |
setAnchor(String anchor) |
void |
setBlockComments(List<CommentLine> blockComments) |
void |
setEndComments(List<CommentLine> endComments) |
void |
setInLineComments(List<CommentLine> inLineComments) |
void |
setTag(Tag tag) |
void |
setTwoStepsConstruction(boolean twoStepsConstruction) |
void |
setType(Class<? extends Object> type) |
void |
setUseClassConstructor(Boolean useClassConstructor) |
boolean |
useClassConstructor() |
protected Mark endMark
protected boolean resolved
protected Boolean useClassConstructor
public Tag getTag()
Every node has a tag assigned. The tag is either local or global.
public Mark getEndMark()
public abstract NodeId getNodeId()
public Mark getStartMark()
public void setTag(Tag tag)
public final boolean equals(Object obj)
public void setTwoStepsConstruction(boolean twoStepsConstruction)
public boolean isTwoStepsConstruction()
Two-step construction is required whenever a node is a child (direct or indirect) of it self. That is, if a recursive structure is build using anchors and aliases.
Set by Composer
, used during the
construction process.
Only relevant during loading.
true
if the node is self referenced.public boolean useClassConstructor()
public void setUseClassConstructor(Boolean useClassConstructor)
@Deprecated public boolean isResolved()
Resolver
.public String getAnchor()
public void setAnchor(String anchor)
public List<CommentLine> getInLineComments()
public void setInLineComments(List<CommentLine> inLineComments)
public List<CommentLine> getBlockComments()
public void setBlockComments(List<CommentLine> blockComments)
public List<CommentLine> getEndComments()
NOTE: these comment should occur only in the last node in a document, when walking the node tree "in order"
public void setEndComments(List<CommentLine> endComments)
Copyright © 2008–2021. All rights reserved.