public final class GlobalNode extends AbstractExprNode
Important: Do not use outside of Soy code (treat as superpackage-private).
ExprNode.ConstantNode, ExprNode.Kind, ExprNode.OperatorNode, ExprNode.ParentExprNode, ExprNode.PrimitiveNode| Modifier and Type | Field and Description |
|---|---|
static GlobalNode |
ERROR |
SPACES| Constructor and Description |
|---|
GlobalNode(String name,
SourceLocation sourceLocation) |
| Modifier and Type | Method and Description |
|---|---|
GlobalNode |
clone()
Copies this node.
|
ExprNode.Kind |
getKind()
Gets this node's kind (corresponding to this node's specific type).
|
String |
getName()
Returns the name of the global.
|
SoyType |
getType()
Gets the data type of this node.
|
String |
toSourceString()
Builds a Soy source string that could be the source for this node.
|
getParent, getSourceLocationcouldHaveSyntaxVersionAtLeast, getNearestAncestor, getSyntaxVersionBound, hasAncestor, maybeSetSyntaxVersionBound, setParent, toString, toTreeStringequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcouldHaveSyntaxVersionAtLeast, getNearestAncestor, getSyntaxVersionBound, hasAncestor, maybeSetSyntaxVersionBound, setParent, toTreeStringpublic static final GlobalNode ERROR
public GlobalNode(String name, SourceLocation sourceLocation)
name - The name of the global.sourceLocation - The node's source location.public ExprNode.Kind getKind()
ExprNodepublic SoyType getType()
ExprNodepublic String getName()
public String toSourceString()
Nodepublic GlobalNode 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.