public class XPathContextMajor extends XPathContextMinor
Modifier and Type | Class and Description |
---|---|
static class |
XPathContextMajor.ThreadManager
The ThreadManager is used to manage asynchronous execution of xsl:result-document instructions in Saxon-EE.
|
XPathContextMinor.LastValue
currentDestination, stackFrame, temporaryOutputState
Constructor and Description |
---|
XPathContextMajor(Controller controller)
Constructor should only be called by the Controller,
which acts as a XPathContext factory.
|
XPathContextMajor(Item item,
Executable exec)
Constructor for use in free-standing Java applications.
|
Modifier and Type | Method and Description |
---|---|
void |
createThreadManager()
Create a new thread manager.
|
Sequence[] |
getAllVariableValues()
Get a all the variables in the stack frame
|
Component |
getCurrentComponent()
Get the current component
|
XPathException |
getCurrentException()
Get the current exception (in saxon:catch)
|
GroupIterator |
getCurrentGroupIterator()
Get the current group iterator.
|
GroupIterator |
getCurrentMergeGroupIterator()
Get the current merge group iterator.
|
Component.M |
getCurrentMode()
Get the current mode.
|
RegexIterator |
getCurrentRegexIterator()
Get the current regex iterator.
|
Rule |
getCurrentTemplateRule()
Get the current template.
|
UnfailingErrorListener |
getErrorListener()
Get the error listener.
|
ParameterSet |
getLocalParameters()
Get the local parameters for the current template call.
|
ContextOriginator |
getOrigin()
Get information about the creating expression or other construct.
|
TailCallLoop.TailCallInfo |
getTailCallInfo()
Determine whether the body of a function is to be repeated, due to tail-recursive function calls
|
Component |
getTargetComponent(int bindingSlot)
Bind a component reference to a component.
|
XPathContextMajor.ThreadManager |
getThreadManager()
Get the thread manager in use for this context.
|
ParameterSet |
getTunnelParameters()
Get the tunnel parameters for the current template call.
|
javax.xml.transform.URIResolver |
getURIResolver()
Get the URI resolver.
|
XPathContextMajor |
newContext()
Construct a new context as a copy of another.
|
static XPathContextMajor |
newContext(XPathContextMinor prev)
Create a new "major" context (one that is capable of holding a stack frame with local variables
|
static XPathContextMajor |
newThreadContext(XPathContextMinor prev)
Make a copy of the supplied context for use in a new thread (typically for
an asynchronous xsl:result-document
|
void |
openStackFrame(int numberOfVariables)
Create a new stack frame large enough to hold a given number of local variables,
for which no stack frame map is available.
|
void |
openStackFrame(SlotManager map)
Create a new stack frame for local variables, using the supplied SlotManager to
define the allocation of slots to individual variables
|
void |
requestTailCall(TailCallLoop.TailCallInfo targetFn,
Sequence[] variables)
Reset the local stack frame.
|
void |
resetAllVariableValues(Sequence[] values)
Overwrite all the variables in the stack frame
|
void |
resetParameterValues(Sequence[] values)
Overwrite all the parameters in the stack frame.
|
void |
resetStackFrameMap(SlotManager map,
int numberOfParams)
Reset the stack frame variable map, while reusing the StackFrame object itself.
|
void |
setCurrentComponent(Component component)
Set the current component, that is, the component being evaluated.
|
void |
setCurrentException(XPathException exception)
Set the current exception (in saxon:catch)
|
void |
setCurrentGroupIterator(GroupIterator iterator)
Set the current grouping iterator.
|
void |
setCurrentMergeGroupIterator(GroupIterator iterator)
Set the current merge group iterator.
|
void |
setCurrentMode(Component.M mode)
Set the current mode.
|
void |
setCurrentRegexIterator(RegexIterator currentRegexIterator)
Set the current regex iterator.
|
void |
setCurrentTemplateRule(Rule rule)
Set the current template.
|
void |
setErrorListener(javax.xml.transform.ErrorListener listener)
Set the error listener.
|
void |
setLocalParameters(ParameterSet localParameters)
Set the local parameters for the current template call.
|
void |
setOrigin(ContextOriginator expr)
Set the creating expression (for use in diagnostics).
|
void |
setStackFrame(SlotManager map,
Sequence[] variables)
Set the local stack frame.
|
void |
setTunnelParameters(ParameterSet tunnelParameters)
Set the tunnel parameters for the current template call.
|
void |
setURIResolver(javax.xml.transform.URIResolver resolver)
Set an object that will be used to resolve URIs used in
document(), etc.
|
int |
useLocalParameter(StructuredQName paramName,
int slotNumber,
boolean isTunnel)
Use local parameter.
|
void |
waitForChildThreads()
Wait for child threads started under the control of this context to finish.
|
evaluateLocalVariable, getCaller, getConfiguration, getContextItem, getController, getCurrentDateTime, getCurrentIterator, getCurrentOutputUri, getImplicitTimezone, getLast, getNamePool, getReceiver, getStackFrame, getTemporaryOutputState, isAtLast, iterateStackFrames, makeStackFrameMutable, newCleanContext, newMinorContext, setCaller, setCurrentIterator, setCurrentOutputUri, setLocalVariable, setReceiver, setTemporaryOutputState
public XPathContextMajor(Controller controller)
controller
- the Controllerpublic XPathContextMajor(Item item, Executable exec)
item
- the item to use as the initial context item. If this is null,
the comtext item is initially undefined (which will cause a dynamic error
if it is referenced).exec
- the Executablepublic XPathContextMajor newContext()
newContext
in interface XPathContext
newContext
in class XPathContextMinor
public static XPathContextMajor newContext(XPathContextMinor prev)
prev
- the previous context (the one causing the new context to be created)public static XPathContextMajor newThreadContext(XPathContextMinor prev)
prev
- the context to be copiedpublic XPathContextMajor.ThreadManager getThreadManager()
getThreadManager
in interface XPathContext
getThreadManager
in class XPathContextMinor
public void createThreadManager()
public void waitForChildThreads() throws XPathException
waitForChildThreads
in interface XPathContext
waitForChildThreads
in class XPathContextMinor
XPathException
- if any of the child threads have failed with a dynamic
error.public ParameterSet getLocalParameters()
getLocalParameters
in interface XPathContext
getLocalParameters
in class XPathContextMinor
public void setLocalParameters(ParameterSet localParameters)
localParameters
- the supplied parameterspublic ParameterSet getTunnelParameters()
getTunnelParameters
in interface XPathContext
getTunnelParameters
in class XPathContextMinor
public void setTunnelParameters(ParameterSet tunnelParameters)
tunnelParameters
- the supplied tunnel parameterspublic void setOrigin(ContextOriginator expr)
Expression
, allowing information
about the calling instruction to be obtained, or null.public ContextOriginator getOrigin()
public void setStackFrame(SlotManager map, Sequence[] variables)
map
- the SlotManager, which holds static details of the allocation of variables to slotsvariables
- the array of "slots" to hold the actual variable values. This array will be
copied if it is too small to hold all the variables defined in the SlotManagerpublic void resetStackFrameMap(SlotManager map, int numberOfParams)
map
- the SlotManager representing the stack frame contentsnumberOfParams
- the number of parameters required on the new stack framepublic Sequence[] getAllVariableValues()
public void resetAllVariableValues(Sequence[] values)
values
- an array holding all the variables, each referenceable by its slot number;
the caller must ensure this is the correct length (and valid in other ways)public void resetParameterValues(Sequence[] values)
values
- an array holding all the parameters, each referenceable by its slot number;
the caller must ensure this is the correct length (and valid in other ways)public void requestTailCall(TailCallLoop.TailCallInfo targetFn, Sequence[] variables)
targetFn
- the user function being called using tail recursionvariables
- the parameter to be supplied to the user functionpublic TailCallLoop.TailCallInfo getTailCallInfo()
public void openStackFrame(SlotManager map)
map
- the SlotManager for the new stack framepublic void openStackFrame(int numberOfVariables)
numberOfVariables
- The number of local variables to be accommodated.public void setCurrentMode(Component.M mode)
mode
- the new current modepublic Component.M getCurrentMode()
getCurrentMode
in interface XPathContext
getCurrentMode
in class XPathContextMinor
public void setCurrentTemplateRule(Rule rule)
rule
- the current template rule, or null to indicate that there is no current template rulepublic Rule getCurrentTemplateRule()
getCurrentTemplateRule
in interface XPathContext
getCurrentTemplateRule
in class XPathContextMinor
public void setCurrentGroupIterator(GroupIterator iterator)
iterator
- the new current GroupIteratorpublic GroupIterator getCurrentGroupIterator()
getCurrentGroupIterator
in interface XPathContext
getCurrentGroupIterator
in class XPathContextMinor
public void setCurrentMergeGroupIterator(GroupIterator iterator)
iterator
- the new current GroupIteratorpublic GroupIterator getCurrentMergeGroupIterator()
getCurrentMergeGroupIterator
in interface XPathContext
getCurrentMergeGroupIterator
in class XPathContextMinor
public void setCurrentRegexIterator(RegexIterator currentRegexIterator)
currentRegexIterator
- the current regex iteratorpublic RegexIterator getCurrentRegexIterator()
getCurrentRegexIterator
in interface XPathContext
getCurrentRegexIterator
in class XPathContextMinor
public int useLocalParameter(StructuredQName paramName, int slotNumber, boolean isTunnel) throws XPathException
useLocalParameter
in interface XPathContext
useLocalParameter
in class XPathContextMinor
paramName
- the name of the parameterslotNumber
- the slot number of the parameter on the callee's stack frameisTunnel
- True if a tunnel parameter is required, else falseXPathException
public void setURIResolver(javax.xml.transform.URIResolver resolver)
resolver
- An object that implements the URIResolver interface, or
null.public javax.xml.transform.URIResolver getURIResolver()
getURIResolver
in interface XPathContext
getURIResolver
in class XPathContextMinor
public void setErrorListener(javax.xml.transform.ErrorListener listener)
listener
- the ErrorListener to be usedpublic UnfailingErrorListener getErrorListener()
getErrorListener
in interface XPathContext
getErrorListener
in class XPathContextMinor
setErrorListener(ErrorListener)
method; if that was not an UnfailingErrorListener
,
it will have been wrapped in a DelegatingErrorListener
, and it is the DelegatingErrorListener
that this method returns.public void setCurrentException(XPathException exception)
exception
- the current exceptionpublic XPathException getCurrentException()
getCurrentException
in interface XPathContext
getCurrentException
in class XPathContextMinor
public Component getCurrentComponent()
getCurrentComponent
in interface XPathContext
getCurrentComponent
in class XPathContextMinor
public void setCurrentComponent(Component component)
component
- the current componentpublic Component getTargetComponent(int bindingSlot)
getTargetComponent
in interface XPathContext
getTargetComponent
in class XPathContextMinor
bindingSlot
- Binding slots are allocated statically to the external component references
in every component: for example, in the case of a template, to all global
variable references, named function calls, and named template calls within
that template. The binding slot therefore identifies the name of the
component that is required; and the selection of an actual component is
done by selection from the binding vector of the component currently being
executedCopyright (c) 2004-2018 Saxonica Limited. All rights reserved.