net.sf.saxon.expr.instruct
Class CallTemplate.CallTemplatePackage

java.lang.Object
  extended by net.sf.saxon.expr.instruct.CallTemplate.CallTemplatePackage
All Implemented Interfaces:
TailCall
Enclosing class:
CallTemplate

public static class CallTemplate.CallTemplatePackage
extends Object
implements TailCall

A CallTemplatePackage is an object that encapsulates the name of a template to be called, the parameters to be supplied, and the execution context. This object can be returned as a tail call, so that the actual call is made from a lower point on the stack, allowing a tail-recursive template to execute in a finite stack size


Constructor Summary
CallTemplate.CallTemplatePackage(Template template, ParameterSet params, ParameterSet tunnelParams, Instruction instruction, XPathContext evaluationContext)
          Construct a CallTemplatePackage that contains information about a call.
 
Method Summary
 TailCall processLeavingTail()
          Process the template call encapsulated by this package.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CallTemplate.CallTemplatePackage

public CallTemplate.CallTemplatePackage(Template template,
                                        ParameterSet params,
                                        ParameterSet tunnelParams,
                                        Instruction instruction,
                                        XPathContext evaluationContext)
Construct a CallTemplatePackage that contains information about a call.

Parameters:
template - the Template to be called
params - the parameters to be supplied to the called template
tunnelParams - the tunnel parameter supplied to the called template
evaluationContext - saved context information from the Controller (current mode, etc) which must be reset to ensure that the template is called with all the context information intact
Method Detail

processLeavingTail

public TailCall processLeavingTail()
                            throws XPathException
Process the template call encapsulated by this package.

Specified by:
processLeavingTail in interface TailCall
Returns:
another TailCall. This will never be the original call, but it may be the next recursive call. For example, if A calls B which calls C which calls D, then B may return a TailCall to A representing the call from B to C; when this is processed, the result may be a TailCall representing the call from C to D.
Throws:
XPathException - if a dynamic error occurs


Copyright (c) 2004-2010 Saxonica Limited. All rights reserved.