public abstract class Instruction extends Expression implements TailCallReturner
EFFECTIVE_BOOLEAN_VALUE, EVALUATE_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, MAX_COST, MAX_SEQUENCE_LENGTH, MAX_STRING_LENGTH, PROCESS_METHOD, staticProperties, UNBOUNDED_LOWER, UNBOUNDED_UPPER, UPDATE_METHOD, WATCH_METHOD
Constructor and Description |
---|
Instruction()
Constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
alwaysCreatesNewNodes()
Ask whether it is guaranteed that every item in the result of this instruction
is a newly created node.
|
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).
|
protected static XPathException |
dynamicError(Location loc,
XPathException error,
XPathContext context)
Construct an exception with diagnostic information.
|
java.lang.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
|
java.lang.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().
|
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
|
int |
getNetCost()
Return the estimated cost of evaluating an expression.
|
javax.xml.transform.SourceLocator |
getSourceLocator()
Get a SourceLocator identifying the location of this instruction
|
boolean |
isInstruction()
Ask whether this expression is an 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.
|
boolean |
mayCreateNewNodes()
Ask whether this instruction potentially creates and returns new nodes.
|
abstract java.lang.Iterable<Operand> |
operands()
Get the immediate sub-expressions of this expression, with information about the relationship
of each expression to its parent expression.
|
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.
|
protected boolean |
someOperandCreatesNewNodes()
Helper method for
mayCreateNewNodes() - returns true if any operand creates new nodes |
addToPathMap, adoptChildExpression, allowExtractingCommonSubexpressions, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeHashCode, computeStaticProperties, copy, dynamicError, effectiveBooleanValue, equals, evaluatePendingUpdates, explain, export, getCardinality, getConfiguration, getCost, getDependencies, getEvaluationMethod, getExtraProperty, getIntegerBounds, getInterpretedExpression, getIntrinsicDependencies, getLocalRetainedStaticContext, getLocation, getObjectName, getPackageData, getParentExpression, getProperties, getProperty, getRetainedStaticContext, getScopingExpression, getSlotsUsed, getSpecialProperties, getStaticBaseURI, getStaticBaseURIString, getStaticType, getStaticUType, getStreamerName, hasCompatibleStaticContext, hashCode, hasSpecialProperty, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isCallOn, isEqual, isIdentical, isLiftable, isMultiThreaded, isStaticPropertiesKnown, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, markTailFunctionCalls, operandList, operandSparseList, optimize, optimizeChildren, prepareForStreaming, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setExtraProperty, setFiltered, setFlattened, setLocation, setParentExpression, setRetainedStaticContext, setRetainedStaticContextLocally, setRetainedStaticContextThoroughly, setStaticProperty, simplify, simplifyChildren, staticTypeCheck, suppressValidation, toPattern, toShortString, toString, typeCheck, typeCheckChildren, typeError, unordered, verifyParentPointers
public int getImplementationMethod()
getImplementationMethod
in class Expression
Expression.ITERATE_METHOD
or Expression.EVALUATE_METHOD
or
Expression.PROCESS_METHOD
public boolean isInstruction()
Expression
isInstruction
in class Expression
public int getInstructionNameCode()
public java.lang.String getExpressionName()
getExpressionName
in class Expression
public ItemType getItemType()
getItemType
in class Expression
public int computeCardinality()
computeCardinality
in class Expression
public abstract java.lang.Iterable<Operand> operands()
Expression
If the expression is a Callable, then it is required that the order of the operands returned by this function is the same as the order of arguments supplied to the corresponding call() method.
operands
in class Expression
public abstract TailCall processLeavingTail(XPathContext context) throws XPathException
processLeavingTail
in interface TailCallReturner
context
- 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 Expression
context
- The dynamic context, giving access to the current node,
the current variables, etc.XPathException
- if a dynamic error occurspublic javax.xml.transform.SourceLocator getSourceLocator()
protected static XPathException dynamicError(Location 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 Expression
public int getNetCost()
getNetCost
in class Expression
public boolean mayCreateNewNodes()
public boolean alwaysCreatesNewNodes()
protected final boolean someOperandCreatesNewNodes()
mayCreateNewNodes()
- returns true if any operand creates new nodespublic Item<?> evaluateItem(XPathContext context) throws XPathException
evaluateItem
in class Expression
context
- 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 Expression
context
- supplies the context for evaluationXPathException
- if any dynamic error occurs evaluating the
expressionpublic final java.lang.CharSequence evaluateAsString(XPathContext context) throws XPathException
evaluateAsString
in class Expression
context
- The context in which the expression is to be evaluatedXPathException
- if any dynamic error occurs evaluating the
expressionjava.lang.ClassCastException
- if the result type of the
expression is not xs:string?public int getConstructType()
getConstructType
in class Expression
LocationKind
public boolean isXSLT()
Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.