public final class XPathVariable extends java.lang.Object implements VariableDeclaration, Binding, java.io.Serializable
IndependentContext
.
Note that once declared, this object is thread-safe: it does not hold the actual variable
value, which means it can be used with any number of evaluations of a given XPath expression,
in series or in parallel.
A variable can be given a value by calling
XPathDynamicContext.setVariable(XPathVariable, net.sf.saxon.om.ValueRepresentation)
.
Note that the value of the variable is not held in the XPathVariable object, but in the
XPathDynamicContext, which means that the XPathVariable itself can be used in multiple threads.
?????? | ????? |
---|---|
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.
|
SequenceType |
getRequiredType()
Get the required type of this variable.
|
StructuredQName |
getVariableQName()
Get the name of the variable as a QNameValue.
|
boolean |
isAssignable()
Test whether it is permitted to assign to the variable using the saxon:assign
extension element.
|
boolean |
isGlobal()
Ask whether the binding is local or global.
|
protected static XPathVariable |
make(StructuredQName name)
Factory method, for use by the declareVariable method of class IndependentContext
|
void |
registerReference(BindingReference ref)
Method called by the XPath expression parser to register a reference to this variable.
|
void |
setRequiredType(SequenceType requiredType)
Set the required type of this variable.
|
void |
setSlotNumber(int slotNumber)
Set the slot number allocated to this variable.
|
protected static XPathVariable make(StructuredQName name)
name
- the name of the variable to createpublic boolean isGlobal()
public final boolean isAssignable()
isAssignable
???? Binding
public void setRequiredType(SequenceType requiredType)
item()*
is assumed.requiredType
- the required typepublic SequenceType getRequiredType()
item()*
is returned.getRequiredType
???? Binding
public void setSlotNumber(int slotNumber)
slotNumber
- the slot number to be allocatedpublic int getLocalSlotNumber()
getLocalSlotNumber
???? Binding
public StructuredQName getVariableQName()
getVariableQName
???? Binding
getVariableQName
???? VariableDeclaration
public void registerReference(BindingReference ref)
registerReference
???? VariableDeclaration
ref
- the variable referencepublic ValueRepresentation evaluateVariable(XPathContext context)
evaluateVariable
???? Binding
context
- The dynamic evaluation context