public final class VarRefNode extends AbstractExprNode
ExprNode.ConstantNode, ExprNode.Kind, ExprNode.OperatorNode, ExprNode.ParentExprNode, ExprNode.PrimitiveNode| Modifier and Type | Field and Description |
|---|---|
static VarRefNode |
ERROR |
SPACES| Constructor and Description |
|---|
VarRefNode(String name,
SourceLocation sourceLocation,
boolean isDollarSignIjParameter,
VarDefn defn) |
| Modifier and Type | Method and Description |
|---|---|
VarRefNode |
copy(CopyState copyState)
See
Node.copy(CopyState) for a description of the copy contract. |
VarDefn |
getDefnDecl() |
ExprNode.Kind |
getKind()
Gets this node's kind (corresponding to this node's specific type).
|
String |
getName()
Returns the name of the variable.
|
SoyType |
getType()
Gets the data type of this node.
|
boolean |
isDollarSignIjParameter()
Returns Whether this is an
$ij parameter reference. |
boolean |
isInjected()
Returns Whether this is an injected parameter reference.
|
boolean |
isLocalVar()
Returns whether this is a local variable reference.
|
Boolean |
isPossibleParam()
Returns whether this might be a local variable reference.
|
void |
setDefn(VarDefn defn) |
void |
setSubstituteType(SoyType type)
Override the type of the variable when used in this context.
|
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 static final VarRefNode ERROR
public VarRefNode(String name, SourceLocation sourceLocation, boolean isDollarSignIjParameter, @Nullable VarDefn defn)
name - The name of the variable.sourceLocation - The node's source location.isDollarSignIjParameter - Whether this is an $ij variable.defn - (optional) The variable declaration for this variable.public ExprNode.Kind getKind()
ExprNodepublic SoyType getType()
ExprNodepublic String getName()
public boolean isDollarSignIjParameter()
$ij parameter reference.
You almost certainly don't want to use this method and instead want isInjected().
public boolean isInjected()
public void setDefn(VarDefn defn)
defn - the varDecl to setpublic VarDefn getDefnDecl()
public boolean isLocalVar()
public Boolean isPossibleParam()
public void setSubstituteType(SoyType type)
type - The overridden type value.public String toSourceString()
Nodepublic VarRefNode copy(CopyState copyState)
ExprNodeNode.copy(CopyState) for a description of the copy contract.