public class StreamInstr extends Instruction implements PushToPull.Pusher
EFFECTIVE_BOOLEAN_VALUE, EVALUATE_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, MAX_SEQUENCE_LENGTH, MAX_STRING_LENGTH, PROCESS_METHOD, staticProperties, UNBOUNDED_LOWER, UNBOUNDED_UPPER, UPDATE_METHOD, WATCH_METHOD
Constructor and Description |
---|
StreamInstr(Expression hrefExp,
Expression body,
ParseOptions options) |
Modifier and Type | Method and Description |
---|---|
boolean |
allowExtractingCommonSubexpressions()
Ask whether common subexpressions found in the operands of this expression can
be extracted and evaluated outside the expression itself.
|
Expression |
checkStreamability(java.util.List<java.lang.String> reasons,
int streamability,
boolean strict) |
int |
computeDependencies()
Compute the dependencies of an expression, as the union of the
dependencies of its subexpressions.
|
int |
computeSpecialProperties()
Get the static properties of this expression (other than its type).
|
Expression |
copy(RebindingMap rebindings)
Copy an expression.
|
void |
export(ExpressionPresenter out)
Diagnostic print of expression structure.
|
Inversion |
getAction() |
Expression |
getBody() |
java.lang.String |
getExpressionName()
Get a name identifying the kind of expression, in terms meaningful to a user.
|
Expression |
getHref() |
SequenceIterator |
iterate(XPathContext context)
Return an Iterator to iterate over the values of a sequence.
|
boolean |
mayCreateNewNodes()
Determine whether this instruction creates new nodes.
|
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.
|
Expression |
optimize(ExpressionVisitor visitor,
ContextItemStaticInfo contextItemType)
Perform optimisation of an expression and its subexpressions.
|
Expression |
prepareForStreaming(PackageData pack) |
TailCall |
processLeavingTail(XPathContext context)
ProcessLeavingTail: called to do the real work of this instruction.
|
void |
push(XPathContext context)
Evaluate the instruction in push mode
|
void |
setBody(Expression body) |
void |
setHref(Expression href) |
void |
setUsedAccumulators(java.util.Set<? extends Accumulator> used) |
Expression |
typeCheck(ExpressionVisitor visitor,
ContextItemStaticInfo contextInfo)
Perform type checking of an expression and its subexpressions.
|
alwaysCreatesNewNodes, assembleParams, assembleTunnelParams, computeCardinality, dynamicError, evaluateAsString, evaluateItem, getConstructType, getImplementationMethod, getInstructionName, getInstructionNameCode, getItemType, getNetCost, getSourceLocator, isInstruction, isXSLT, process, someOperandCreatesNewNodes
addToPathMap, adoptChildExpression, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, computeHashCode, computeStaticProperties, dynamicError, effectiveBooleanValue, evaluatePendingUpdates, explain, 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, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isCallOn, isCallOnSystemFunction, isIdentical, isLiftable, isMultiThreaded, isSameExpression, isStaticPropertiesKnown, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, markTailFunctionCalls, operandList, operandSparseList, optimizeChildren, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setExtraProperty, setFiltered, setFlattened, setLocation, setParentExpression, setRetainedStaticContext, setRetainedStaticContextLocally, setRetainedStaticContextThoroughly, setStaticProperty, simplify, simplifyChildren, staticTypeCheck, suppressValidation, toPattern, toShortString, toString, typeCheckChildren, typeError, unordered, verifyParentPointers, verifyParentPointers
public StreamInstr(Expression hrefExp, Expression body, ParseOptions options)
public java.lang.String getExpressionName()
getExpressionName
in class Instruction
public Expression getHref()
public void setHref(Expression href)
public Expression getBody()
public void setBody(Expression body)
public void setUsedAccumulators(java.util.Set<? extends Accumulator> used)
public 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 Instruction
public boolean allowExtractingCommonSubexpressions()
allowExtractingCommonSubexpressions
in class Expression
public Expression typeCheck(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException
typeCheck
in class Expression
visitor
- an expression visitorcontextInfo
- Information available statically about the context item: whether it is (possibly)
absent; its static type; its streaming posture.XPathException
- if an error is discovered during this phase
(typically a type error)public Expression optimize(ExpressionVisitor visitor, ContextItemStaticInfo contextItemType) throws XPathException
This method is called after all references to functions and variables have been resolved to the declaration of the function or variable, and after all type checking has been done.
optimize
in class Expression
visitor
- an expression visitorcontextItemType
- the static type of "." at the point where this expression is invoked.
The parameter is set to null if it is known statically that the context item will be undefined.
If the type of the context item is not known statically, the argument is set to
Type.ITEM_TYPE
XPathException
- if an error is discovered during this phase
(typically a type error)public Expression prepareForStreaming(PackageData pack) throws XPathException
XPathException
public Expression checkStreamability(java.util.List<java.lang.String> reasons, int streamability, boolean strict) throws XPathException
XPathException
public boolean mayCreateNewNodes()
mayCreateNewNodes
in class Instruction
public int computeDependencies()
computeDependencies
in class Expression
public int computeSpecialProperties()
computeSpecialProperties
in class Instruction
public Inversion getAction()
public void export(ExpressionPresenter out) throws XPathException
export
in interface ExportAgent
export
in class Expression
out
- the expression presenter used to display the structureXPathException
- if the export fails, for example if an expression is found that won't work
in the target environment.public Expression copy(RebindingMap rebindings)
copy
in class Expression
rebindings
- public TailCall processLeavingTail(XPathContext context) throws XPathException
processLeavingTail
in interface TailCallReturner
processLeavingTail
in class Instruction
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 push(XPathContext context) throws XPathException
push
in interface PushToPull.Pusher
context
- the evaluation contextXPathException
- in the event of a failureQuitParsingException
- if there was an early exit, that is, if the instruction was evaluated
without reading the input to completionpublic SequenceIterator iterate(XPathContext context) throws XPathException
iterate
in class Instruction
context
- supplies the context for evaluationXPathException
- if any dynamic error occurs evaluating the
expressionCopyright (c) 2004-2018 Saxonica Limited. All rights reserved.