public abstract class Instruction extends ComputedExpression implements javax.xml.transform.SourceLocator, TailCallReturner
locationId, staticProperties
EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD
Constructor and Description |
---|
Instruction()
Constructor
|
Modifier and Type | Method and Description |
---|---|
static void |
appendItem(Item it,
SequenceReceiver out,
int locationId)
Static method to append an item that results from evaluating an expression to the current
result receiver.
|
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(javax.xml.transform.SourceLocator loc,
XPathException error,
XPathContext context)
Construct an exception with diagnostic information.
|
java.lang.String |
evaluateAsString(XPathContext context)
Evaluate an expression as a String.
|
Item |
evaluateItem(XPathContext context)
Evaluate an expression as a single item.
|
int |
getImplementationMethod()
An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process().
|
InstructionInfo |
getInstructionInfo()
Get InstructionInfo for this expression
|
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
|
javax.xml.transform.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)
Offer promotion for this subexpression.
|
protected void |
promoteInst(PromotionOffer offer)
Handle promotion offers, that is, non-local tree rewrites.
|
abstract Expression |
simplify(StaticContext env)
Simplify an expression.
|
adoptChildExpression, checkPermittedContents, computeDependencies, computeStaticProperties, doPromotion, dynamicError, effectiveBooleanValue, getCardinality, getColumnNumber, getConstructType, getDependencies, getExecutable, getHostLanguage, getIntrinsicDependencies, getLineNumber, getLocationId, getLocationProvider, getParentExpression, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, hasBadParentPointer, iterateSubExpressions, markTailFunctionCalls, replaceSubExpression, resetStaticProperties, setLocationId, setParentExpression, setParentExpression, suppressValidation, typeError
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getColumnNumber, getLineNumber, getPublicId, getSystemId
display, optimize, typeCheck
public int getImplementationMethod()
getImplementationMethod
in interface Expression
getImplementationMethod
in class ComputedExpression
public int getInstructionNameCode()
public ItemType getItemType(TypeHierarchy th)
getItemType
in interface Expression
th
- public int computeCardinality()
computeCardinality
in class ComputedExpression
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
public void process(XPathContext context) throws XPathException
process
in interface Expression
process
in class ComputedExpression
context
- The dynamic context, giving access to the current node,
the current variables, etc.XPathException
public javax.xml.transform.SourceLocator getSourceLocator()
protected static XPathException dynamicError(javax.xml.transform.SourceLocator loc, XPathException error, XPathContext context)
error
- The exception containing information about the errorcontext
- The controller of the transformationprotected static ParameterSet assembleParams(XPathContext context, WithParam[] actualParams) throws XPathException
XPathException
protected static ParameterSet assembleTunnelParams(XPathContext context, WithParam[] actualParams) throws XPathException
XPathException
public abstract Expression simplify(StaticContext env) throws XPathException
simplify
in interface Expression
simplify
in class ComputedExpression
env
- the static contextXPathException
- if an error is discovered during expression
rewritingpublic int computeSpecialProperties()
computeSpecialProperties
in class ComputedExpression
public boolean createsNewNodes()
protected void promoteInst(PromotionOffer offer) throws XPathException
offer
- The type of rewrite being offeredXPathException
public Expression promote(PromotionOffer offer) throws XPathException
promote
in interface Expression
promote
in class ComputedExpression
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 expressionXPathException
- if any error is detectedpublic Item evaluateItem(XPathContext context) throws XPathException
evaluateItem
in interface Expression
evaluateItem
in class ComputedExpression
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 interface Expression
iterate
in class ComputedExpression
context
- supplies the context for evaluationXPathException
- if any dynamic error occurs evaluating the
expressionpublic final java.lang.String evaluateAsString(XPathContext context) throws XPathException
evaluateAsString
in interface Expression
evaluateAsString
in class ComputedExpression
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 InstructionInfo getInstructionInfo()
ComputedExpression
getInstructionInfo
in interface InstructionInfoProvider
getInstructionInfo
in class ComputedExpression
public static void appendItem(Item it, SequenceReceiver out, int locationId) throws XPathException
it
- the item: possibly a FunctionCallPackageout
- the ReceiverXPathException
public boolean isXSLT()