public final class GlobalNode extends AbstractExprNode
Important: Do not use outside of Soy code (treat as superpackage-private).
ExprNode.Kind, ExprNode.OperatorNode, ExprNode.ParentExprNode, ExprNode.PrimitiveNode| Constructor and Description |
|---|
GlobalNode(String name,
SourceLocation sourceLocation) |
| Modifier and Type | Method and Description |
|---|---|
GlobalNode |
copy(CopyState copyState)
See
Node.copy(CopyState) for a description of the copy contract. |
static GlobalNode |
error(SourceLocation location) |
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.
|
ExprNode.PrimitiveNode |
getValue() |
boolean |
isResolved() |
void |
resolve(SoyType soyType,
ExprNode.PrimitiveNode value) |
void |
setName(String name)
Only to be used by
RewriteGlobalsPass. |
boolean |
shouldSuppressUnknownGlobalErrors()
Returns true if 'unknown global' errors should not be reported for this node.
|
void |
suppressUnknownGlobalErrors()
Call this method to suppress unknown global errors for this node.
|
String |
toSourceString()
Builds a Soy source string that could be the source for this node.
|
getParent, getSourceLocationcouldHaveSyntaxVersionAtLeast, equals, getNearestAncestor, getSyntaxVersionUpperBound, hasAncestor, hashCode, maybeSetSyntaxVersionUpperBound, setParent, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitcouldHaveSyntaxVersionAtLeast, getNearestAncestor, getSyntaxVersionUpperBound, hasAncestor, maybeSetSyntaxVersionUpperBound, setParentpublic GlobalNode(String name, SourceLocation sourceLocation)
name - The name of the global.sourceLocation - The node's source location.public static GlobalNode error(SourceLocation location)
public ExprNode.Kind getKind()
ExprNodepublic SoyType getType()
ExprNodepublic void resolve(SoyType soyType, ExprNode.PrimitiveNode value)
public boolean isResolved()
public ExprNode.PrimitiveNode getValue()
public String getName()
public void setName(String name)
RewriteGlobalsPass.public void suppressUnknownGlobalErrors()
public boolean shouldSuppressUnknownGlobalErrors()
public String toSourceString()
NodeNote: Some nodes do not have a direct mapping to Soy source (such as nodes created during some optimization passes). Thus this method may not always be supported.
public GlobalNode copy(CopyState copyState)
ExprNodeNode.copy(CopyState) for a description of the copy contract.