|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.sxpath.XPathVariable
public final class XPathVariable
An object representing an XPath variable for use in the standalone XPath API. The object
can only be created by calling the declareVariable method of class 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.
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. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
protected static XPathVariable make(StructuredQName name)
name
- the name of the variable to create
public boolean isGlobal()
isGlobal
in interface Binding
public final boolean isAssignable()
isAssignable
in interface Binding
public void setRequiredType(SequenceType requiredType)
item()*
is assumed.
requiredType
- the required typepublic SequenceType getRequiredType()
item()*
is returned.
getRequiredType
in interface Binding
public void setSlotNumber(int slotNumber)
slotNumber
- the slot number to be allocatedpublic int getLocalSlotNumber()
getLocalSlotNumber
in interface Binding
public StructuredQName getVariableQName()
getVariableQName
in interface Binding
getVariableQName
in interface VariableDeclaration
public void registerReference(BindingReference ref)
registerReference
in interface VariableDeclaration
ref
- the variable referencepublic ValueRepresentation evaluateVariable(XPathContext context)
evaluateVariable
in interface Binding
context
- The dynamic evaluation context
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |