VarDefn.Kind| Modifier and Type | Field and Description |
|---|---|
protected SoyType |
type
The data type of the value.
|
| Constructor and Description |
|---|
LocalVar(LocalVar localVar,
SoyNode.LocalVarNode declaringNode)
Copy constructor for when the declaring node is being cloned.
|
LocalVar(String name,
SoyNode.LocalVarNode declaringNode,
SoyType type) |
| Modifier and Type | Method and Description |
|---|---|
SoyNode.LocalVarNode |
declaringNode() |
boolean |
equals(Object obj) |
int |
hashCode() |
boolean |
isInjected()
Returns true if this is an
$ij variable or an @inject param. |
VarDefn.Kind |
kind()
What kind of variable this is (param, local var, etc).
|
int |
localVariableIndex()
Returns the index of this variable in the local variable table of the template or
-1
for ij params. |
String |
name()
The name of this variable.
|
void |
setLocalVariableIndex(int i)
Assigns the index of this variable in the local variable table for its containing template.
|
void |
setType(SoyType type)
Setter for the type - this is necessary because sometimes we don't know
the variable type until after analysis.
|
String |
toString() |
SoyType |
type()
Returns the data type of this variable.
|
protected SoyType type
public LocalVar(String name, SoyNode.LocalVarNode declaringNode, SoyType type)
name - The variable name.declaringNode - The statement in which this variable is defined.type - The data type of the variable.public LocalVar(LocalVar localVar, SoyNode.LocalVarNode declaringNode)
public VarDefn.Kind kind()
VarDefnpublic void setType(SoyType type)
type - The data type of the variable.public SoyNode.LocalVarNode declaringNode()
public boolean isInjected()
VarDefn$ij variable or an @inject param.public SoyType type()
VarDefnpublic void setLocalVariableIndex(int i)
VarDefnsetLocalVariableIndex in interface VarDefnpublic int localVariableIndex()
VarDefn-1
for ij params.localVariableIndex in interface VarDefn