public abstract class AbstractSoyNode extends AbstractNode implements SoyNode
Important: Do not use outside of Soy code (treat as superpackage-private).
SoyNode.BlockCommandNode, SoyNode.BlockNode, SoyNode.CommandNode, SoyNode.ConditionalBlockNode, SoyNode.ExprHolderNode, SoyNode.Kind, SoyNode.LocalVarBlockNode, SoyNode.LocalVarInlineNode, SoyNode.LocalVarNode, SoyNode.LoopNode, SoyNode.MsgBlockNode, SoyNode.MsgPlaceholderInitialNode, SoyNode.MsgSubstUnitNode, SoyNode.ParentSoyNode<N extends SoyNode>, SoyNode.RenderUnitNode, SoyNode.SplitLevelTopNode<N extends SoyNode>, SoyNode.StandaloneNode, SoyNode.StatementNode
SPACES
Modifier | Constructor and Description |
---|---|
protected |
AbstractSoyNode(AbstractSoyNode orig)
Copy constructor.
|
protected |
AbstractSoyNode(int id) |
Modifier and Type | Method and Description |
---|---|
abstract SoyNode |
clone()
Copies this node.
|
int |
getId()
Returns this node's id.
|
SoyNode.ParentSoyNode<?> |
getParent()
Gets this node's parent.
|
SourceLocation |
getSourceLocation()
The location in the file from which it was parsed or derived.
|
void |
setId(int id)
Sets this node's id.
|
void |
setSourceLocation(SourceLocation srcLoc)
Sets the source location (file path and line number) for this node.
|
String |
toString() |
couldHaveSyntaxVersionAtLeast, getNearestAncestor, getSyntaxVersionBound, hasAncestor, maybeSetSyntaxVersionBound, setParent, toTreeString
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
couldHaveSyntaxVersionAtLeast, getNearestAncestor, getSyntaxVersionBound, hasAncestor, maybeSetSyntaxVersionBound, setParent, toSourceString, toTreeString
protected AbstractSoyNode(int id)
id
- The id for this node.protected AbstractSoyNode(AbstractSoyNode orig)
orig
- The node to copy.public void setId(int id)
SoyNode
Important: The id should already be set during construction, so this method should only be used during cloning.
public int getId()
SoyNode
public SourceLocation getSourceLocation()
getSourceLocation
in interface SoyNode
public void setSourceLocation(SourceLocation srcLoc)
SoyNode
setSourceLocation
in interface SoyNode
srcLoc
- The source location for this node.public SoyNode.ParentSoyNode<?> getParent()
Node
public abstract SoyNode clone()
Node
All clone() overrides should follow this contract:
{@literal @}Override public T clone() {
return new T(this);
}
NOTE: this means we do not ultimately delegate to Object.clone(), ever.
TODO(lukes): The usecases for a clone method are few and far between. Making the AST nodes immutable (or at least unmodifiable) would be preferable to maintaining our clone() methods.
public String toString()
toString
in class AbstractNode