public abstract class SimpleNodeConstructor extends Instruction
Modifier and Type | Field and Description |
---|---|
protected Operand |
selectOp |
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 |
---|
SimpleNodeConstructor()
Default constructor used by subclasses
|
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.
|
boolean |
alwaysCreatesNewNodes()
Ask whether it is guaranteed that every item in the result of this instruction
is a newly created node
|
protected java.lang.String |
checkContent(java.lang.String data,
XPathContext context)
Check the content of the node, and adjust it if necessary.
|
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).
|
Item |
evaluateItem(XPathContext context)
Evaluate as an expression.
|
NodeName |
evaluateNodeName(XPathContext context)
Run-time method to compute the name of the node being constructed.
|
Expression |
getSelect()
Get the select expression, that is the expression that computes the content of the constructed node.
|
java.lang.String |
getStreamerName()
Get the (partial) name of a class that supports streaming of this kind of expression
|
boolean |
isLocal() |
SequenceIterator |
iterate(XPathContext context)
Return an Iterator to iterate over the values of a sequence.
|
abstract void |
localTypeCheck(ExpressionVisitor visitor,
ContextItemStaticInfo contextItemType)
Method to perform type-checking specific to the kind of instruction
|
boolean |
mayCreateNewNodes()
Ask 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.
|
TailCall |
processLeavingTail(XPathContext context)
Process this instruction
|
abstract void |
processValue(java.lang.CharSequence value,
XPathContext context)
Process the value of the node, to create the new node.
|
void |
setSelect(Expression select)
Set the select expression: the value of this expression determines the string-value of the node
|
Expression |
typeCheck(ExpressionVisitor visitor,
ContextItemStaticInfo contextInfo)
The typeCheck() method is called in XQuery, where node constructors
are implemented as Expressions.
|
assembleParams, assembleTunnelParams, dynamicError, evaluateAsString, getConstructType, getExpressionName, getImplementationMethod, getInstructionName, getInstructionNameCode, getItemType, getNetCost, getSourceLocator, isInstruction, isXSLT, process, someOperandCreatesNewNodes
addToPathMap, adoptChildExpression, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeHashCode, computeStaticProperties, copy, dynamicError, effectiveBooleanValue, 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, 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
protected Operand selectOp
public SimpleNodeConstructor()
public void setSelect(Expression select)
select
- the expression that computes the string value of the nodepublic Expression getSelect()
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 final boolean mayCreateNewNodes()
mayCreateNewNodes
in class Instruction
public boolean alwaysCreatesNewNodes()
alwaysCreatesNewNodes
in class Instruction
public int computeCardinality()
computeCardinality
in class Instruction
public int computeSpecialProperties()
computeSpecialProperties
in class Instruction
public boolean allowExtractingCommonSubexpressions()
allowExtractingCommonSubexpressions
in class Expression
public abstract void localTypeCheck(ExpressionVisitor visitor, ContextItemStaticInfo contextItemType) throws XPathException
visitor
- an expression visitorcontextItemType
- the static type of the context itemXPathException
- if a type error is detectedpublic Expression typeCheck(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException
typeCheck
in class Expression
contextInfo
- information about the dynamic contextvisitor
- an expression visitorXPathException
- if any static errors are found in this expression
or any of its childrenpublic Expression optimize(ExpressionVisitor visitor, ContextItemStaticInfo contextItemType) throws XPathException
Expression
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 java.lang.String getStreamerName()
getStreamerName
in class Expression
public TailCall processLeavingTail(XPathContext context) throws XPathException
processLeavingTail
in interface TailCallReturner
processLeavingTail
in class Instruction
context
- the dynamic context of the transformationXPathException
- if a dynamic error occurs during the evaluation
of the instructionpublic abstract void processValue(java.lang.CharSequence value, XPathContext context) throws XPathException
value
- the string value of the new nodecontext
- the dynamic evaluation contextXPathException
- if a dynamic error occurspublic Item evaluateItem(XPathContext context) throws XPathException
evaluateItem
in class Instruction
context
- The context in which the expression is to be evaluatedXPathException
- if any dynamic error occurs evaluating the
expressionprotected java.lang.String checkContent(java.lang.String data, XPathContext context) throws XPathException
data
- the supplied contentcontext
- the dynamic contextXPathException
- if the content is invalidpublic NodeName evaluateNodeName(XPathContext context) throws XPathException
context
- the XPath dynamic evaluation contextXPathException
- if any failure occurspublic SequenceIterator iterate(XPathContext context) throws XPathException
Instruction
iterate
in class Instruction
context
- supplies the context for evaluationXPathException
- if any dynamic error occurs evaluating the
expressionpublic boolean isLocal()
Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.