Class ReplaceNodeExpression
- java.lang.Object
- 
- net.sf.saxon.expr.Expression
- 
- com.saxonica.ee.update.BasicUpdatingExpression
- 
- com.saxonica.ee.update.ReplaceNodeExpression
 
 
 
- 
- All Implemented Interfaces:
- ExportAgent,- Locatable,- IdentityComparable,- Traceable
 
 public class ReplaceNodeExpression extends BasicUpdatingExpression A "replace node" expression in XQuery Update
- 
- 
Field Summary- 
Fields inherited from class net.sf.saxon.expr.ExpressionEFFECTIVE_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 SummaryConstructors Constructor Description ReplaceNodeExpression(Expression target, Expression replacement, int constructionMode, boolean inheritNamespaces)Create a ReplaceNodeExpression
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Expressioncopy(RebindingMap rebindings)Copy an expression.voidevaluatePendingUpdates(XPathContext context, PendingUpdateList pul)Evaluate an updating expression, adding the results to a Pending Update List.voidexport(ExpressionPresenter out)Diagnostic print of expression structure.java.lang.StringgetExpressionName()Get a name identifying the kind of expression, in terms meaningful to a user.ExpressiongetReplacementExp()ExpressiongetTargetExp()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.voidsetReplacementExp(Expression replacement)voidsetTargetExp(Expression targetExpression)ExpressiontypeCheck(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo)Perform type checking of an expression and its subexpressions.- 
Methods inherited from class com.saxonica.ee.update.BasicUpdatingExpressioncomputeCardinality, evaluateItem, getImplementationMethod, getItemType, isUpdatingExpression, iterate, process
 - 
Methods inherited from class net.sf.saxon.expr.ExpressionaddToPathMap, adoptChildExpression, allowExtractingCommonSubexpressions, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeHashCode, computeSpecialProperties, computeStaticProperties, dynamicError, effectiveBooleanValue, equals, evaluateAsString, explain, getCardinality, getConfiguration, getCost, getDependencies, getEvaluationMethod, getExtraProperty, getIntegerBounds, getInterpretedExpression, getIntrinsicDependencies, getLocalRetainedStaticContext, getLocation, getNetCost, getObjectName, getPackageData, getParentExpression, getProperties, getProperty, getRetainedStaticContext, getScopingExpression, getSlotsUsed, getSpecialProperties, getStaticBaseURI, getStaticBaseURIString, getStaticType, getStaticUType, getStreamerName, getTracingTag, hasCompatibleStaticContext, hashCode, hasSpecialProperty, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isCallOn, isEqual, isIdentical, isInstruction, isLiftable, isMultiThreaded, isStaticPropertiesKnown, isSubtreeExpression, 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, typeCheckChildren, typeError, unordered, verifyParentPointers
 - 
Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface net.sf.saxon.trace.TraceablegatherProperties
 
- 
 
- 
- 
- 
Constructor Detail- 
ReplaceNodeExpressionpublic ReplaceNodeExpression(Expression target, Expression replacement, int constructionMode, boolean inheritNamespaces) Create a ReplaceNodeExpression- Parameters:
- target- expression that computes the node to be replaced
- replacement- expression that supplies the replacement node(s)
- constructionMode- set to Validation.STRIP or Validation.PRESERVE - indicates whether the replacement nodes retain their type annotation
- inheritNamespaces- true if namespaces mode is inherit
 
 
- 
 - 
Method Detail- 
getTargetExppublic Expression getTargetExp() 
 - 
setTargetExppublic void setTargetExp(Expression targetExpression) 
 - 
getReplacementExppublic Expression getReplacementExp() 
 - 
setReplacementExppublic void setReplacementExp(Expression replacement) 
 - 
operandspublic 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. Default implementation works off the results of iterateSubExpressions()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. - Overrides:
- operandsin class- Expression
- Returns:
- an iterator containing the sub-expressions of this expression
 
 - 
typeCheckpublic Expression typeCheck(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException Perform type checking of an expression and its subexpressions. This is the second phase of static optimization.This checks statically that the operands of the expression have the correct type; if necessary it generates code to do run-time type checking or type conversion. A static type error is reported only if execution cannot possibly succeed, that is, if a run-time type error is inevitable. The call may return a modified form of the expression. This method is called after all references to functions and variables have been resolved to the declaration of the function or variable. However, the types of such functions and variables may not be accurately known if they have not been explicitly declared. If the implementation returns a value other than "this", then it is required to ensure that the parent pointer and location information in the returned expression have been set up correctly. It should not rely on the caller to do this, although for historical reasons many callers do so. - Overrides:
- typeCheckin class- Expression
- Parameters:
- visitor- an expression visitor
- contextInfo- static information about the context item
- Returns:
- the original expression, rewritten to perform necessary run-time type checks, and to perform other type-related optimizations
- Throws:
- XPathException- if an error is discovered during this phase (typically a type error)
 
 - 
copypublic Expression copy(RebindingMap rebindings) Copy an expression. This makes a deep copy.- Specified by:
- copyin class- Expression
- Parameters:
- rebindings- variables to be re-bound
- Returns:
- the copy of the original expression
 
 - 
exportpublic void export(ExpressionPresenter out) throws XPathException Diagnostic print of expression structure. The abstract expression tree is written to the supplied output destination.- Specified by:
- exportin interface- ExportAgent
- Specified by:
- exportin class- Expression
- Parameters:
- out- the expression presenter used to display the structure
- Throws:
- XPathException- if the export fails, for example if an expression is found that won't work in the target environment.
 
 - 
evaluatePendingUpdatespublic void evaluatePendingUpdates(XPathContext context, PendingUpdateList pul) throws XPathException Evaluate an updating expression, adding the results to a Pending Update List. The default implementation of this method, which is used for non-updating expressions, throws an UnsupportedOperationException- Overrides:
- evaluatePendingUpdatesin class- Expression
- Parameters:
- context- the XPath dynamic evaluation context
- pul- the pending update list to which the results should be written
- Throws:
- XPathException- if evaluation fails
 
 - 
getExpressionNamepublic java.lang.String getExpressionName() Get a name identifying the kind of expression, in terms meaningful to a user.- Overrides:
- getExpressionNamein class- Expression
- Returns:
- a name identifying the kind of expression, in terms meaningful to a user. The name will always be in the form of a lexical XML QName, and should match the name used in export() output displaying the expression.
 
 
- 
 
-