org.elasticsearch.util.yaml.snakeyaml.nodes
Class YamlNode

java.lang.Object
  extended by org.elasticsearch.util.yaml.snakeyaml.nodes.YamlNode
Direct Known Subclasses:
CollectionNode, ScalarNode

public abstract class YamlNode
extends java.lang.Object

Base class for all nodes.

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.elasticsearch.util.yaml.snakeyaml.constructor package.


Field Summary
protected  Mark endMark
           
protected  boolean resolved
          true when the tag is assigned by the resolver
protected  java.lang.Boolean useClassConstructor
           
 
Constructor Summary
YamlNode(Tag tag, Mark startMark, Mark endMark)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 Mark getEndMark()
           
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()
          Indicates if the tag was added by Resolver.
 boolean isTwoStepsConstruction()
          Indicates if this node must be constructed in two steps.
 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()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

endMark

protected Mark endMark

resolved

protected boolean resolved
true when the tag is assigned by the resolver


useClassConstructor

protected java.lang.Boolean useClassConstructor
Constructor Detail

YamlNode

public YamlNode(Tag tag,
                Mark startMark,
                Mark endMark)
Method Detail

getTag

public Tag getTag()
Tag of this node.

Every node has a tag assigned. The tag is either local or global.

Returns:
Tag of this node.

getEndMark

public Mark getEndMark()

getNodeId

public abstract NodeId getNodeId()
For error reporting.

Returns:
scalar, sequence, mapping
See Also:
variable 'id' in PyYAML

getStartMark

public Mark getStartMark()

setTag

public void setTag(Tag tag)

equals

public final boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getType

public java.lang.Class<? extends java.lang.Object> getType()

setType

public void setType(java.lang.Class<? extends java.lang.Object> type)

setTwoStepsConstruction

public void setTwoStepsConstruction(boolean twoStepsConstruction)

isTwoStepsConstruction

public boolean isTwoStepsConstruction()
Indicates if this node must be constructed in two steps.

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.

Returns:
true if the node is self referenced.

hashCode

public final int hashCode()
Overrides:
hashCode in class java.lang.Object

useClassConstructor

public boolean useClassConstructor()

setUseClassConstructor

public void setUseClassConstructor(java.lang.Boolean useClassConstructor)

isResolved

public boolean isResolved()
Indicates if the tag was added by Resolver.

Returns:
true if the tag of this node was resolved