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.
| Modifier and Type | Field and Description |
|---|---|
protected Optional<Mark> |
endMark |
protected boolean |
resolved
true when the tag is assigned by the resolver
|
| Constructor and Description |
|---|
Node(Tag tag,
Optional<Mark> startMark,
Optional<Mark> endMark)
Create Node to be parsed
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj)
Node is only equal to itself
|
Optional<Anchor> |
getAnchor()
Get the anchor if it was defined for this Node
|
Optional<Mark> |
getEndMark() |
abstract NodeType |
getNodeType() |
Object |
getProperty(String key)
Get the custom runtime property.
|
Optional<Mark> |
getStartMark() |
Tag |
getTag()
Tag of this node.
|
int |
hashCode() |
boolean |
isRecursive()
Indicates if this node must be constructed in two steps.
|
void |
setAnchor(Optional<Anchor> anchor)
Set the anchor for this Node
|
Object |
setProperty(String key,
Object value)
Define a custom runtime property.
|
void |
setRecursive(boolean recursive) |
void |
setTag(Tag tag) |
public Tag getTag()
Every node has a tag assigned. The tag is either local or global.
public abstract NodeType getNodeType()
public void setTag(Tag tag)
public final boolean equals(Object obj)
public void setRecursive(boolean recursive)
public boolean isRecursive()
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 Optional<Anchor> getAnchor()
public void setAnchor(Optional<Anchor> anchor)
anchor - - the Anchor for this Nodepublic Object setProperty(String key, Object value)
key - - the key for the custom propertyvalue - - the value for the custom propertyCopyright © 2018–2019. All rights reserved.