public abstract class Instruction extends Expression implements SourceLocator, TailCallReturner
EFFECTIVE_BOOLEAN_VALUE, EVALUATE_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, locationId, MAX_SEQUENCE_LENGTH, MAX_STRING_LENGTH, PROCESS_METHOD, staticProperties, UNBOUNDED_LOWER, UNBOUNDED_UPPER, WATCH_METHOD| Constructor and Description |
|---|
Instruction()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
static ParameterSet |
assembleParams(XPathContext context,
WithParam[] actualParams)
Assemble a ParameterSet.
|
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
|
String |
getExpressionName()
Get a name identifying the kind of expression, in terms meaningful to a user.
|
int |
getImplementationMethod()
An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process().
|
String |
getInstructionName()
Get a name identifying the kind of instruction, in terms meaningful to a user.
|
int |
getInstructionNameCode()
Get the namecode of the instruction for use in diagnostics
|
ItemType |
getItemType()
Get the item type of the items returned by evaluating this instruction
|
protected SequenceIterator |
getIteratorFromProcessMethod(XPathContext context)
Helper method to construct an iterator over the results of the expression when all that
the expression itself offers is a process() method.
|
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.
|
Pattern |
toStreamingPattern(Configuration config)
Convert this expression to a streaming pattern (a pattern used internally to match nodes during
push processing of an event stream)
|
addToPathMap, adoptChildExpression, checkForUpdatingSubexpressions, checkPermittedContents, clearStreamabilityData, computeDependencies, computeStaticProperties, copy, doPromotion, dynamicError, effectiveBooleanValue, evaluatePendingUpdates, explain, explain, getCardinality, getColumnNumber, getConfiguration, getContainer, getDependencies, getEvaluationMethod, getExpressionCompiler, getHostLanguage, getIntegerBounds, getIntrinsicDependencies, getLineNumber, getLocationId, getObjectName, getPosture, getProperties, getProperty, getPublicId, getSlotsUsed, getSpecialProperties, getStreamability, getStreamingAdjunct, getSweep, getSystemId, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isIdentical, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, iterateEvents, makeStreamingAdjunct, markTailFunctionCalls, operandList, operands, optimize, replaceOperand, resetLocalStaticProperties, setContainer, setEvaluationMethod, setFiltered, setFlattened, setLocationId, setPostureAndSweep, simplify, staticTypeCheck, suppressValidation, toPattern, toShortString, toString, typeCheck, typeError, unorderedclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetColumnNumber, getLineNumber, getPublicId, getSystemIdpublic int getImplementationMethod()
getImplementationMethod in class ExpressionExpression.ITERATE_METHOD or Expression.EVALUATE_METHOD or
Expression.PROCESS_METHODpublic int getInstructionNameCode()
public String getInstructionName()
public String getExpressionName()
getExpressionName in class Expressionpublic ItemType getItemType()
getItemType in class Expressionpublic int computeCardinality()
computeCardinality in class Expressionpublic abstract TailCall processLeavingTail(XPathContext context) throws XPathException
processLeavingTail in interface TailCallReturnercontext - The dynamic context of the transformation, giving access to the current node,
the current variables, etc.XPathException - if a dynamic error occurs during the evaluation
of the instructionpublic void process(XPathContext context) throws XPathException
process in class Expressioncontext - The dynamic context, giving access to the current node,
the current variables, etc.XPathException - if a dynamic error occurspublic SourceLocator getSourceLocator()
protected static XPathException dynamicError(SourceLocator loc, XPathException error, XPathContext context)
loc - the location of the errorerror - The exception containing information about the errorcontext - The controller of the transformationpublic static ParameterSet assembleParams(XPathContext context, WithParam[] actualParams) throws XPathException
context - the XPath dynamic contextactualParams - the set of with-param parameters that specify tunnel="no"XPathException - if an error occurs evaluating one of the
parameterspublic static ParameterSet assembleTunnelParams(XPathContext context, WithParam[] actualParams) throws XPathException
context - the XPath dynamic contextactualParams - the set of with-param parameters that specify tunnel="yes"XPathException - if an error occurs evaluating one of the
tunnel parameterspublic int computeSpecialProperties()
computeSpecialProperties in class Expressionpublic boolean createsNewNodes()
protected void promoteInst(PromotionOffer offer) throws XPathException
offer - The type of rewrite being offeredXPathException - if an error occurspublic Expression promote(PromotionOffer offer, Expression parent) throws XPathException
promote in class Expressionoffer - 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 expressionparent - the parent of the subexpressionXPathException - if any error is detectedpublic Item evaluateItem(XPathContext context) throws XPathException
evaluateItem in class Expressioncontext - The context in which the expression is to be evaluatedXPathException - if any dynamic error occurs evaluating the
expressionpublic SequenceIterator iterate(XPathContext context) throws XPathException
iterate in class Expressioncontext - supplies the context for evaluationXPathException - if any dynamic error occurs evaluating the
expressionprotected final SequenceIterator getIteratorFromProcessMethod(XPathContext context) throws XPathException
context - the dynamic evaluation contextXPathException - if a dynamic error occurspublic final CharSequence evaluateAsString(XPathContext context) throws XPathException
evaluateAsString in class Expressioncontext - The context in which the expression is to be evaluatedXPathException - if any dynamic error occurs evaluating the
expressionClassCastException - if the result type of the
expression is not xs:string?public int getConstructType()
getConstructType in interface InstructionInfogetConstructType in class ExpressionLocationpublic boolean isXSLT()
public Pattern toStreamingPattern(Configuration config)
ExpressiontoStreamingPattern in class Expressionconfig - the Saxon configurationCopyright (c) 2004-2014 Saxonica Limited. All rights reserved.