public abstract class Node
extends java.lang.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 |
---|---|
private java.lang.String |
anchor |
private java.util.List<CommentLine> |
blockComments |
private java.util.List<CommentLine> |
endComments |
protected Mark |
endMark |
private java.util.List<CommentLine> |
inLineComments |
protected boolean |
resolved
true when the tag is assigned by the resolver
|
private Mark |
startMark |
private Tag |
tag |
private boolean |
twoStepsConstruction |
private java.lang.Class<? extends java.lang.Object> |
type |
protected java.lang.Boolean |
useClassConstructor |
Constructor and Description |
---|
Node(Tag tag,
Mark startMark,
Mark endMark) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Node is only equal to itself
|
java.lang.String |
getAnchor() |
java.util.List<CommentLine> |
getBlockComments()
The ordered list of blank lines and block comments (full line) that appear before this node.
|
java.util.List<CommentLine> |
getEndComments()
The ordered list of blank lines and block comments (full line) that appear AFTER this node.
|
Mark |
getEndMark() |
java.util.List<CommentLine> |
getInLineComments()
The ordered list of in-line comments.
|
abstract NodeId |
getNodeId()
For error reporting.
|
Mark |
getStartMark() |
Tag |
getTag()
Tag of this node.
|
java.lang.Class<? extends java.lang.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(java.lang.String anchor) |
void |
setBlockComments(java.util.List<CommentLine> blockComments) |
void |
setEndComments(java.util.List<CommentLine> endComments) |
void |
setInLineComments(java.util.List<CommentLine> inLineComments) |
void |
setTag(Tag tag) |
void |
setTwoStepsConstruction(boolean twoStepsConstruction) |
void |
setType(java.lang.Class<? extends java.lang.Object> type) |
void |
setUseClassConstructor(java.lang.Boolean useClassConstructor) |
boolean |
useClassConstructor() |
private Tag tag
private final Mark startMark
protected Mark endMark
private java.lang.Class<? extends java.lang.Object> type
private boolean twoStepsConstruction
private java.lang.String anchor
private java.util.List<CommentLine> inLineComments
private java.util.List<CommentLine> blockComments
private java.util.List<CommentLine> endComments
protected boolean resolved
protected java.lang.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(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.Class<? extends java.lang.Object> getType()
public void setType(java.lang.Class<? extends java.lang.Object> type)
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 final int hashCode()
hashCode
in class java.lang.Object
public boolean useClassConstructor()
public void setUseClassConstructor(java.lang.Boolean useClassConstructor)
@Deprecated public boolean isResolved()
Resolver
.public java.lang.String getAnchor()
public void setAnchor(java.lang.String anchor)
public java.util.List<CommentLine> getInLineComments()
public void setInLineComments(java.util.List<CommentLine> inLineComments)
public java.util.List<CommentLine> getBlockComments()
public void setBlockComments(java.util.List<CommentLine> blockComments)
public java.util.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(java.util.List<CommentLine> endComments)