public abstract class SimpleNodeConstructor extends Instruction
Modifier and Type | Field and Description |
---|---|
protected Expression |
select |
EFFECTIVE_BOOLEAN_VALUE, EVALUATE_METHOD, EVENT_FEED_METHOD, INHERITED_CONTEXT, INSPECTION_CONTEXT, ITEM_FEED_METHOD, ITERATE_METHOD, locationId, MAX_SEQUENCE_LENGTH, MAX_STRING_LENGTH, NAVIGATION_CONTEXT, NODE_VALUE_CONTEXT, PROCESS_METHOD, PUSH_SELECTION, staticProperties, UNBOUNDED_LOWER, UNBOUNDED_UPPER, W3C_CONSUMING, W3C_FREE_RANGING, W3C_GROUP_CONSUMING, W3C_MOTIONLESS, WATCH_METHOD
Constructor and Description |
---|
SimpleNodeConstructor()
Default constructor used by subclasses
|
Modifier and Type | Method and Description |
---|---|
protected String |
checkContent(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).
|
boolean |
createsNewNodes()
Determine whether this instruction creates new nodes.
|
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 |
getContentExpression()
Get the expression that determines the string value of the constructed node
|
SimpleNodeConstructorAdjunct |
getStreamingAdjunct()
Get a class that supports streamed evaluation of this expression
|
SequenceIterator<Item> |
iterate(XPathContext context)
Return an Iterator to iterate over the values of a sequence.
|
Iterator<SubExpressionInfo> |
iterateSubExpressionInfo()
Get the immediate sub-expressions of this expression, with information about the relationship
of each expression to its parent expression.
|
Iterator<Expression> |
iterateSubExpressions()
Get the immediate sub-expressions of this expression.
|
abstract void |
localTypeCheck(ExpressionVisitor visitor,
ExpressionVisitor.ContextItemType contextItemType)
Method to perform type-checking specific to the kind of instruction
|
Expression |
optimize(ExpressionVisitor visitor,
ExpressionVisitor.ContextItemType contextItemType)
Perform optimisation of an expression and its subexpressions.
|
TailCall |
processLeavingTail(XPathContext context)
Process this instruction
|
abstract void |
processValue(CharSequence value,
XPathContext context)
Process the value of the node, to create the new node.
|
protected void |
promoteInst(PromotionOffer offer)
Offer promotion for subexpressions.
|
boolean |
replaceSubExpression(Expression original,
Expression replacement)
Replace one subexpression by a replacement subexpression
|
void |
setSelect(Expression select,
Configuration config)
Set the select expression: the value of this expression determines the string-value of the node
|
Expression |
simplify(ExpressionVisitor visitor)
Simplify an expression.
|
Expression |
typeCheck(ExpressionVisitor visitor,
ExpressionVisitor.ContextItemType contextItemType)
The typeCheck() method is called in XQuery, where node constructors
are implemented as Expressions.
|
assembleParams, assembleTunnelParams, dynamicError, evaluateAsString, getConstructType, getExpressionName, getImplementationMethod, getInstructionName, getInstructionNameCode, getItemType, getIteratorFromProcessMethod, getSourceLocator, isXSLT, process, promote
addToPathMap, adoptChildExpression, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeStaticProperties, copy, doPromotion, dynamicError, effectiveBooleanValue, evaluatePendingUpdates, explain, explain, getCardinality, getColumnNumber, getColumnNumber, getContainer, getDependencies, getEvaluationMethod, getExecutable, getExpressionCompiler, getHostLanguage, getIntegerBounds, getIntrinsicDependencies, getLineNumber, getLineNumber, getLocationId, getLocationProvider, getObjectName, getProperties, getProperty, getPublicId, getSlotsUsed, getSpecialProperties, getStreamability, getSystemId, getSystemId, hasVariableBinding, implementsStaticTypeCheck, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, iterateEvents, markTailFunctionCalls, resetLocalStaticProperties, setContainer, setEvaluationMethod, setFiltered, setFlattened, setLocationId, staticTypeCheck, suppressValidation, toPattern, toStreamingPattern, toString, typeError
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getColumnNumber, getLineNumber, getPublicId, getSystemId
protected Expression select
public SimpleNodeConstructor()
public void setSelect(Expression select, Configuration config)
select
- the expression that computes the string value of the nodeconfig
- the Saxon configuration (used for example to do early validation of the content
of an attribute against the schema-defined type)public Expression getContentExpression()
public final boolean createsNewNodes()
createsNewNodes
in class Instruction
public int computeCardinality()
computeCardinality
in class Instruction
public Expression simplify(ExpressionVisitor visitor) throws XPathException
Instruction
simplify
in class Instruction
visitor
- an expression visitorXPathException
- if an error is discovered during expression
rewritingpublic int computeSpecialProperties()
computeSpecialProperties
in class Instruction
public abstract void localTypeCheck(ExpressionVisitor visitor, ExpressionVisitor.ContextItemType contextItemType) throws XPathException
visitor
- an expression visitorcontextItemType
- the static type of the context itemXPathException
- if a type error is detectedpublic Expression typeCheck(ExpressionVisitor visitor, ExpressionVisitor.ContextItemType contextItemType) throws XPathException
typeCheck
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 any static errors are found in this expression
or any of its childrenpublic Expression optimize(ExpressionVisitor visitor, ExpressionVisitor.ContextItemType 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 Iterator<Expression> iterateSubExpressions()
Expression
iterateSubExpressions
in class Expression
public Iterator<SubExpressionInfo> iterateSubExpressionInfo()
iterateSubExpressionInfo
in class Expression
public boolean replaceSubExpression(Expression original, Expression replacement)
replaceSubExpression
in class Expression
original
- the original subexpressionreplacement
- the replacement subexpressionpublic SimpleNodeConstructorAdjunct getStreamingAdjunct()
getStreamingAdjunct
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(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 String checkContent(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<Item> iterate(XPathContext context) throws XPathException
Instruction
iterate
in class Instruction
context
- supplies the context for evaluationXPathException
- if any dynamic error occurs evaluating the
expressionprotected void promoteInst(PromotionOffer offer) throws XPathException
promoteInst
in class Instruction
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 detectedCopyright (c) 2004-2013 Saxonica Limited. All rights reserved.