|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.expr.Expression net.sf.saxon.expr.instruct.Instruction net.sf.saxon.expr.instruct.GeneralVariable net.sf.saxon.expr.instruct.GlobalVariable
public class GlobalVariable
A compiled global variable in a stylesheet or query.
Field Summary |
---|
Fields inherited from class net.sf.saxon.expr.instruct.GeneralVariable |
---|
evaluationMode, referenceCount, slotNumber, variableQName |
Fields inherited from class net.sf.saxon.expr.Expression |
---|
EVALUATE_METHOD, EVENT_FEED_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, locationId, PROCESS_METHOD, PUSH_SELECTION, staticProperties, WATCH_METHOD |
Constructor Summary | |
---|---|
GlobalVariable()
Create a global variable |
Method Summary | |
---|---|
protected ValueRepresentation |
actuallyEvaluate(XPathContext context)
Evaluate the global variable, and save its value for use in subsequent references. |
ValueRepresentation |
evaluateVariable(XPathContext context)
Evaluate the variable |
int |
getContainerGranularity()
Get the granularity of the container. |
Executable |
getExecutable()
Get the executable containing this global variable |
int |
getHostLanguage()
Get the host language (XSLT, XQuery, XPath) used to implement the code in this container |
ValueRepresentation |
getSelectValue(XPathContext context)
Evaluate the variable. |
boolean |
isGlobal()
Is this a global variable? |
boolean |
isIndexedVariable()
Ask whether this is an indexed variable |
void |
lookForCycles(Stack referees,
XQueryFunctionLibrary globalFunctionLibrary)
Check for cycles in this variable definition |
TailCall |
processLeavingTail(XPathContext context)
Process the variable declaration |
void |
setContainsLocals(SlotManager map)
The expression that initializes a global variable may itself use local variables. |
protected static void |
setDependencies(Bindery bindery,
GlobalVariable var,
XPathContext context)
Get the variable that is immediately dependent on this one, and register the dependency, so that circularities can be detected across threads. |
void |
setExecutable(Executable executable)
Set the containing executable |
void |
setIndexedVariable()
Mark this as an indexed variable, to allow fast searching |
Methods inherited from class net.sf.saxon.expr.instruct.GeneralVariable |
---|
copy, evaluateItem, explain, getCardinality, getEvaluationMode, getInstructionNameCode, getItemType, getLocalSlotNumber, getRequiredType, getSelectExpression, getSlotNumber, getVariableQName, init, isAssignable, isImplicitlyRequiredParam, isRequiredParam, isTunnelParam, iterate, iterateSubExpressions, optimize, promoteInst, replaceSubExpression, setAssignable, setImplicitlyRequiredParam, setReferenceCount, setRequiredParam, setRequiredType, setSelectExpression, setSlotNumber, setTunnel, setVariableQName, simplify, typeCheck |
Methods inherited from class net.sf.saxon.expr.instruct.Instruction |
---|
assembleParams, assembleTunnelParams, computeCardinality, computeSpecialProperties, createsNewNodes, dynamicError, evaluateAsString, getConstructType, getExpressionName, getImplementationMethod, getInstructionName, getIteratorFromProcessMethod, getSourceLocator, isXSLT, process, promote |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.sf.saxon.expr.Container |
---|
getLocationProvider |
Methods inherited from interface javax.xml.transform.SourceLocator |
---|
getColumnNumber, getLineNumber, getPublicId, getSystemId |
Constructor Detail |
---|
public GlobalVariable()
Method Detail |
---|
public Executable getExecutable()
getExecutable
in interface Container
getExecutable
in class Expression
public void setExecutable(Executable executable)
executable
- the executable that contains this global variablepublic int getHostLanguage()
getHostLanguage
in interface Container
getHostLanguage
in class Expression
Configuration.XSLT
or Configuration.XQUERY
public void setIndexedVariable()
public boolean isIndexedVariable()
public int getContainerGranularity()
getContainerGranularity
in interface Container
public void setContainsLocals(SlotManager map)
map
- The stack frame map for local variables used while evaluating this global
variable.public boolean isGlobal()
isGlobal
in interface Binding
isGlobal
in class GeneralVariable
public void lookForCycles(Stack referees, XQueryFunctionLibrary globalFunctionLibrary) throws XPathException
referees
- the calls leading up to this one; it's an error if this variable is on the
stack, because that means it calls itself directly or indirectly. The stack may contain
variable definitions (GlobalVariable objects) and user-defined functions (UserFunction objects).
It will never contain the same object more than once.globalFunctionLibrary
- the library containing all global functions
XPathException
public TailCall processLeavingTail(XPathContext context) throws XPathException
processLeavingTail
in interface TailCallReturner
processLeavingTail
in class Instruction
context
- The dynamic context of the transformation, giving access to the current node,
the current variables, etc.
XPathException
public ValueRepresentation getSelectValue(XPathContext context) throws XPathException
getSelectValue
in class GeneralVariable
context
- the XPath dynamic context
XPathException
public ValueRepresentation evaluateVariable(XPathContext context) throws XPathException
evaluateVariable
in interface Binding
context
- the XPath dynamic evaluation context
XPathException
protected ValueRepresentation actuallyEvaluate(XPathContext context) throws XPathException
context
- the XPath dynamic context
XPathException
- if evaluation failsprotected static void setDependencies(Bindery bindery, GlobalVariable var, XPathContext context) throws XPathException
bindery
- the Binderyvar
- the global variable or parameter being evaluatedcontext
- the dynamic evaluation context
XPathException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |