net.sf.saxon.trans
public final class Variable extends Object implements VariableDeclaration, Binding, Serializable
Method Summary | |
---|---|
ValueRepresentation | evaluateVariable(XPathContext context)
Get the value of the variable. |
int | getLocalSlotNumber()
If this is a local variable held on the local stack frame, return the corresponding slot number.
|
int | getNameCode()
Establish the nameCode of the name of this variable. |
String | getVariableName()
Get the name of the variable. |
boolean | isAssignable()
Test whether it is permitted to assign to the variable using the saxon:assign
extension element. |
boolean | isGlobal()
Indicate whether the binding is local or global. |
static Variable | make(QNameValue name, Configuration config)
Factory method, for use by the declareVariable method of class StandaloneContext |
static Variable | make(String qname, Configuration config)
Factory method, retained for backwards compatibility |
void | registerReference(BindingReference ref)
Method called by the XPath expression parser to register a reference to this variable.
|
void | setSlotNumber(int slotNumber)
Set the slot number allocated to this variable |
void | setUseStack(boolean useStack)
Indicate that values of variables are to be found on the stack, not
in the Variable object itself |
void | setValue(Object value)
Assign a value to the variable. |
void | setXPathValue(ValueRepresentation value)
Assign a value to the variable. |
Parameters: context The dynamic evaluation context
Returns: The value of the variable
Returns: the nameCode
Returns: the name of the variable, as a string (containing the raw QName)
Deprecated: since 8.5: use Variable
Factory method, retained for backwards compatibilityParameters: qname the lexical QName of the variable name
Parameters: slotNumber
Parameters: value the value of the variable, as a Java object. This is converted to the "best fit" XPath data type.
Throws: net.sf.saxon.trans.XPathException if the Java value cannot be converted to an XPath type
Parameters: value the value of the variable, which must be an instance of a class representing a value in the XPath model.