public class CopyModifyExpression extends Expression
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 |
---|
CopyModifyExpression(Expression updateExp,
Expression returnExp,
int validationMode)
Create a copy-modify expression (also known as a transform expresion)
|
Modifier and Type | Method and Description |
---|---|
void |
checkForUpdatingSubexpressions()
Check to ensure that this expression does not contain any inappropriate updating subexpressions.
|
int |
computeCardinality()
Determine the static cardinality of the expression.
|
Expression |
copy()
Copy an expression.
|
Item |
evaluateItem(XPathContext context)
Evaluate an expression as a single item.
|
void |
export(ExpressionPresenter out)
Diagnostic print of expression structure.
|
Expression |
getCopyBindings() |
ExpressionCompiler |
getExpressionCompiler()
Return the compiler of the CopyModify expression
|
int |
getImplementationMethod()
An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process().
|
ItemType |
getItemType()
Determine the data type of the expression, if possible.
|
Expression |
getReturnExp() |
Expression |
getUpdateExp() |
boolean |
isUpdatingExpression()
Determine whether this is an updating expression as defined in the XQuery update specification
|
SequenceIterator |
iterate(XPathContext context)
Return an Iterator to iterate over the values of a sequence.
|
EventIterator |
iterateEvents(XPathContext context)
Deliver the result of the expression as a sequence of events.
|
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
|
void |
setCopyBindings(Expression copyBindings)
Set the copy bindings.
|
void |
setReturnExp(Expression returnExp) |
void |
setUpdateExp(Expression updateExp) |
addToPathMap, adoptChildExpression, checkedOperands, checkPermittedContents, clearStreamabilityData, computeDependencies, computeSpecialProperties, computeStaticProperties, doPromotion, dynamicError, effectiveBooleanValue, evaluateAsString, evaluatePendingUpdates, explain, getCardinality, getConfiguration, getConstructType, getCost, getDependencies, getEvaluationMethod, getExpressionName, getHostLanguage, getIntegerBounds, getIntrinsicDependencies, getLocation, getNetCost, getObjectName, getPackageData, getParentExpression, getPosture, getPostureAndSweepIfKnown, getProperties, getProperty, getRetainedStaticContext, getSlotsUsed, getSpecialProperties, getStaticBaseURI, getStaticBaseURIString, getStreamability, getStreamingAdjunct, getSweep, getSystemId, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isCallOn, isCallOnSystemFunction, isIdentical, isSubtreeExpression, isVacuousExpression, makeStreamingAdjunct, markTailFunctionCalls, operandList, operandSparseList, optimize, optimizeChildren, optimizeForType, promote, promoteChildren, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setFiltered, setFlattened, setLocation, setParentExpression, setPostureAndSweep, setRetainedStaticContext, setRetainedStaticContextLocally, setStaticProperty, simplify, simplifyChildren, staticTypeCheck, suppressValidation, toPattern, toShortString, toStreamingPattern, toString, typeCheck, typeCheckChildren, typeError, unordered
public CopyModifyExpression(Expression updateExp, Expression returnExp, int validationMode)
updateExp
- the expression appearing in the modify clausereturnExp
- the expression appearing in the return clausevalidationMode
- the mode for validating the updated nodes (strict, lax, or skip)public 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 Expression getUpdateExp()
public void setUpdateExp(Expression updateExp)
public Expression getReturnExp()
public void setReturnExp(Expression returnExp)
public Expression getCopyBindings()
public void setCopyBindings(Expression copyBindings)
copyBindings
- the set of Let expressions that bind variables that were copied during the copy
phase and that therefore may be updated during the modify phasepublic int computeCardinality()
computeCardinality
in class Expression
public ItemType getItemType()
This method should always return a result, though it may be the best approximation that is available at the time.
getItemType
in class Expression
public boolean isUpdatingExpression()
isUpdatingExpression
in class Expression
public void checkForUpdatingSubexpressions() throws XPathException
checkForUpdatingSubexpressions
in class Expression
XPathException
- if the expression has a non-permitted updating subexpressionpublic Expression copy()
copy
in class Expression
public int getImplementationMethod()
getImplementationMethod
in class Expression
Expression.ITERATE_METHOD
or Expression.EVALUATE_METHOD
or
Expression.PROCESS_METHOD
public void export(ExpressionPresenter out)
export
in class Expression
out
- the expression presenter used to display the structurepublic SequenceIterator iterate(XPathContext context) throws XPathException
iterate
in class Expression
context
- supplies the context for evaluationXPathException
- if any dynamic error occurs evaluating the
expressionpublic 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 EventIterator iterateEvents(XPathContext context) throws XPathException
The events (of class PullEvent
) are either complete
items, or one of startElement, endElement, startDocument, or endDocument, known
as semi-nodes. The stream of events may also include a nested EventIterator.
If a start-end pair exists in the sequence, then the events between
this pair represent the content of the document or element. The content sequence will
have been processed to the extent that any attribute and namespace nodes in the
content sequence will have been merged into the startElement event. Namespace fixup
will have been performed: that is, unique prefixes will have been allocated to element
and attribute nodes, and all namespaces will be declared by means of a namespace node
in the startElement event or in an outer startElement forming part of the sequence.
However, duplicate namespaces may appear in the sequence.
The content of an element or document may include adjacent or zero-length text nodes, atomic values, and nodes represented as nodes rather than broken down into events.
iterateEvents
in class Expression
context
- The dynamic evaluation contextXPathException
- if a dynamic error occurs during expression evaluationpublic 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 ExpressionCompiler getExpressionCompiler()
getExpressionCompiler
in class Expression
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.