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.StatementNodeSPACES| 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, toTreeStringequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcouldHaveSyntaxVersionAtLeast, getNearestAncestor, getSyntaxVersionBound, hasAncestor, maybeSetSyntaxVersionBound, setParent, toSourceString, toTreeStringprotected AbstractSoyNode(int id)
id - The id for this node.protected AbstractSoyNode(AbstractSoyNode orig)
orig - The node to copy.public void setId(int id)
SoyNodeImportant: The id should already be set during construction, so this method should only be used during cloning.
public int getId()
SoyNodepublic SourceLocation getSourceLocation()
getSourceLocation in interface SoyNodepublic void setSourceLocation(SourceLocation srcLoc)
SoyNodesetSourceLocation in interface SoyNodesrcLoc - The source location for this node.public SoyNode.ParentSoyNode<?> getParent()
Nodepublic abstract SoyNode clone()
NodeAll 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