|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.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 |
| 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 |
getColumnNumber(long locationId)
Get the column number within the document, entity, or module containing a particular location |
int |
getConstructType()
Get the type of construct. |
Container |
getContainer()
Get the container in which this expression is located. |
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 |
int |
getLineNumber(long locationId)
Get the line number within the document, entity or module containing a particular location |
StructuredQName |
getObjectName()
Get a name identifying the object of the expression, for example a function name, template name, variable name, key name, element name, etc. |
Iterator<String> |
getProperties()
Get an iterator over all the properties available. |
Object |
getProperty(String name)
Get the value of a particular property of the instruction. |
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<Container> referees,
XQueryFunctionLibrary globalFunctionLibrary)
Check for cycles in this variable definition |
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 java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.sf.saxon.expr.Container |
|---|
getLocationProvider |
| Methods inherited from interface net.sf.saxon.trace.InstructionInfo |
|---|
getLineNumber, getSystemId |
| Methods inherited from interface org.xml.sax.Locator |
|---|
getColumnNumber, getPublicId |
| Methods inherited from interface javax.xml.transform.SourceLocator |
|---|
getColumnNumber, getPublicId |
| Methods inherited from interface net.sf.saxon.event.LocationProvider |
|---|
getSystemId |
| Constructor Detail |
|---|
public GlobalVariable()
| Method Detail |
|---|
public Executable getExecutable()
getExecutable in interface ContainergetExecutable in class GeneralVariablepublic void setExecutable(Executable executable)
executable - the executable that contains this global variablepublic int getLineNumber(long locationId)
getLineNumber in interface LocationProviderlocationId - identifier of the location in question (as passed down the Receiver pipeline)
public int getColumnNumber(long locationId)
getColumnNumber in interface LocationProviderlocationId - identifier of the location in question (as passed down the Receiver pipeline)
public int getConstructType()
StandardNames: all less than 1024)
or it will be a constant in class Location.
getConstructType in interface InstructionInfopublic StructuredQName getObjectName()
getObjectName in interface InstructionInfopublic Object getProperty(String name)
getProperty in interface InstructionInfoname - The name of the required property
public Iterator<String> getProperties()
getProperties in interface InstructionInfopublic Container getContainer()
getContainer in class GeneralVariablepublic int getHostLanguage()
getHostLanguage in interface ContainerConfiguration.XSLT or Configuration.XQUERYpublic void setIndexedVariable()
public boolean isIndexedVariable()
public int getContainerGranularity()
getContainerGranularity in interface Containerpublic void setContainsLocals(SlotManager map)
map - The stack frame map for local variables used while evaluating this global
variable.public boolean isGlobal()
isGlobal in interface BindingisGlobal in class GeneralVariable
public void lookForCycles(Stack<Container> 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 - if cycles are found
public ValueRepresentation getSelectValue(XPathContext context)
throws XPathException
getSelectValue in class GeneralVariablecontext - the XPath dynamic context
XPathException - if evaluation of the select expression fails
with a dynamic error
public ValueRepresentation evaluateVariable(XPathContext context)
throws XPathException
evaluateVariable in interface Bindingcontext - the XPath dynamic evaluation context
XPathException - if an error occurs while evaluating
the variable
protected ValueRepresentation actuallyEvaluate(XPathContext context)
throws XPathException
context - the XPath dynamic context
XPathException - if evaluation fails
protected 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 | ||||||||