net.sf.saxon.instruct
public abstract class Instruction extends Expression implements SourceLocator, TailCallReturner
Constructor Summary | |
---|---|
Instruction()
Constructor |
Method Summary | |
---|---|
protected static ParameterSet | assembleParams(XPathContext context, WithParam[] actualParams)
Assemble a ParameterSet. |
protected static ParameterSet | assembleTunnelParams(XPathContext context, WithParam[] actualParams)
Assemble a ParameterSet. |
int | computeCardinality()
Get the cardinality of the sequence returned by evaluating this instruction |
int | computeSpecialProperties()
Get the static properties of this expression (other than its type). |
boolean | createsNewNodes()
Determine whether this instruction creates new nodes.
|
protected static XPathException | dynamicError(SourceLocator loc, XPathException error, XPathContext context)
Construct an exception with diagnostic information. |
CharSequence | evaluateAsString(XPathContext context)
Evaluate an expression as a String. |
Item | evaluateItem(XPathContext context)
Evaluate an expression as a single item. |
int | getConstructType()
Get the type of this expression for use in tracing and diagnostics
|
int | getImplementationMethod()
An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process().
|
int | getInstructionNameCode()
Get the namecode of the instruction for use in diagnostics |
ItemType | getItemType(TypeHierarchy th)
Get the item type of the items returned by evaluating this instruction |
SourceLocator | getSourceLocator()
Get a SourceLocator identifying the location of this instruction |
boolean | isXSLT()
Establish whether this is an XSLT instruction or an XQuery instruction
(used to produce appropriate diagnostics) |
SequenceIterator | iterate(XPathContext context)
Return an Iterator to iterate over the values of a sequence. |
void | process(XPathContext context)
Process the instruction, without returning any tail calls |
abstract TailCall | processLeavingTail(XPathContext context)
ProcessLeavingTail: called to do the real work of this instruction. |
Expression | promote(PromotionOffer offer, Expression parent)
Offer promotion for this subexpression. |
protected void | promoteInst(PromotionOffer offer)
Handle promotion offers, that is, non-local tree rewrites. |
abstract Expression | simplify(ExpressionVisitor visitor)
Simplify an expression. |
Parameters: context the XPath dynamic context actualParams the set of with-param parameters that specify tunnel="no"
Returns: a ParameterSet
Parameters: context the XPath dynamic context actualParams the set of with-param parameters that specify tunnel="yes"
Returns: a ParameterSet
Returns: the static cardinality
Returns: a set of flags indicating static properties of this expression
Returns: true if the instruction creates new nodes (or if it can't be proved that it doesn't)
Parameters: loc the location of the error error The exception containing information about the error context The controller of the transformation
Returns: an exception based on the supplied exception, but with location information added relating to this instruction
Parameters: context The context in which the expression is to be evaluated
Returns: the value of the expression, evaluated in the current context. The expression must return a string or (); if the value of the expression is (), this method returns "".
Throws: net.sf.saxon.trans.XPathException if any dynamic error occurs evaluating the expression java.lang.ClassCastException if the result type of the expression is not xs:string?
Parameters: context The context in which the expression is to be evaluated
Returns: the node or atomic value that results from evaluating the expression; or null to indicate that the result is an empty sequence
Throws: XPathException if any dynamic error occurs evaluating the expression
Returns: the type of expression, as enumerated in class Location
Returns: a code identifying the instruction: typically but not always the fingerprint of a name in the XSLT namespace
Parameters: th the type hierarchy cache
Returns: the static item type of the instruction
Returns: the location of this instruction in the source stylesheet or query
Returns: true for XSLT, false for XQuery
Parameters: context supplies the context for evaluation
Returns: a SequenceIterator that can be used to iterate over the result of the expression
Throws: XPathException if any dynamic error occurs evaluating the expression
Parameters: context The dynamic context, giving access to the current node, the current variables, etc.
Parameters: context The dynamic context of the transformation, giving access to the current node, the current variables, etc.
Returns: null if the instruction has completed execution; or a TailCall indicating a function call or template call that is delegated to the caller, to be made after the stack has been unwound so as to save stack space.
Parameters: offer details of the offer, for example the offer to move expressions that don't depend on the context to an outer level in the containing expression parent
Returns: if the offer is not accepted, return this expression unchanged. Otherwise return the result of rewriting the expression to promote this subexpression
Throws: net.sf.saxon.trans.XPathException if any error is detected
Parameters: offer The type of rewrite being offered
Throws: XPathException
Parameters: visitor an expression visitor
Returns: the simplified expression
Throws: net.sf.saxon.trans.XPathException if an error is discovered during expression rewriting