|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.waveset.expression.ExNode
com.waveset.expression.ExDefvar
The node representation for the <defvar> expression.
Variables are typically used to hold computed values which can then be referenced without repeating the computation. Once defined, variables are referenced with a <ref> expression.
Note that we use the same class to represent function argument declarations made with the <defarg> expression.
Field Summary | |
static java.lang.String |
code_id
|
static java.lang.String |
ELEMENT
Name of the XML element. |
Fields inherited from class com.waveset.expression.ExNode |
_bindingCount, _children, _decoration, _parent, trace |
Constructor Summary | |
ExDefvar()
Build a defvar node. |
Method Summary | |
ExValue |
call(ExState state)
Call a variable. |
ExValue |
eval(ExState state)
Override ExNode.eval since we don't want the breakpoint to occur here. |
protected ExValue |
evalInternal(ExState state)
Just clears out this binding |
java.lang.String |
getFunctionName()
Gets the node function name. |
java.lang.String |
getName()
Gets the name of this variable definition. |
int |
getOrdinal()
Gets the ordinal number of the variable. |
void |
parseXml(org.w3c.dom.Element el)
Parse the XML representation, and flesh out the object. |
void |
postProcess()
Overload of the ExNode postProcess method. |
void |
setName(java.lang.String name)
Set the name. |
void |
toXmlAttributes(java.lang.StringBuffer b)
Add attributes in the start tag of this node. |
Methods inherited from class com.waveset.expression.ExNode |
addChild, addChildren, addCommonAttributes, beginTrace, clearOwner, endTrace, evalChild, evalChildToObject, evalChildToString, evalToBoolean, evalToInt, evalToObject, evalToString, getBindingCount, getChild, getChildren, getDecoration, getHiddenVariable, getLocation, getOwner, getParent, isLiteral, parseCommonAttributes, removeChild, resolveFunction, resolveVariable, setBindingCount, setChildren, setDecoration, setEnvironment, setLocation, setOwner, setOwner, setParent, toXml, toXml, toXml, toXmlChildren |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String code_id
public static final java.lang.String ELEMENT
Constructor Detail |
public ExDefvar()
Method Detail |
public java.lang.String getFunctionName()
getFunctionName
in class ExNode
public java.lang.String getName()
public int getOrdinal()
public void setName(java.lang.String name)
public void parseXml(org.w3c.dom.Element el) throws WavesetException
parseXml
in class ExNode
WavesetException
public void toXmlAttributes(java.lang.StringBuffer b)
ExNode
toXmlAttributes
in class ExNode
public void postProcess()
postProcess
in class ExNode
public ExValue eval(ExState state) throws WavesetException
The return value of defvar is null. It has the side effect of registering the definition in the environment.
Actually, the definition happens as a side effect of the postProcess() walk, not during the evaluation of the definition node.
eval
in class ExNode
WavesetException
protected ExValue evalInternal(ExState state) throws WavesetException
evalInternal
in class ExNode
WavesetException
public ExValue call(ExState state) throws WavesetException
This is called in response to the evaluation of an ExReference node, here is where we evaluate the variable initialization expression. This should only be called once, after which the value will be cached in the binding array for the current scope.
WavesetException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |