net.sf.saxon.instruct
public abstract class SimpleNodeConstructor extends Instruction implements DivisibleInstruction
Field Summary | |
---|---|
protected Expression | select |
Constructor Summary | |
---|---|
SimpleNodeConstructor()
Default constructor used by subclasses |
Method Summary | |
---|---|
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. |
int | evaluateNameCode(XPathContext context)
Run-time method to compute the name of the node being constructed. |
CharSequence | expandChildren(XPathContext context)
Expand the stylesheet elements subordinate to this one, returning the result
as a string. |
Expression | getSelect()
Get the expression that determines the string value of the constructed node |
SequenceIterator | iterate(XPathContext context) |
Iterator<Expression> | iterateSubExpressions() |
abstract void | localTypeCheck(ExpressionVisitor visitor, ItemType contextItemType)
Method to perform type-checking specific to the kind of instruction |
Expression | optimize(ExpressionVisitor visitor, ItemType contextItemType) |
TailCall | processLeavingTail(XPathContext context)
Process this instruction |
void | processLeft(Stack<XPathContext> contextStack, Stack state)
In streaming mode, process the first half of the instruction (for example, to start a new document or element) |
void | processRight(Stack<XPathContext> contextStack, Stack state)
In streaming mode, process the right half of the instruction (for example, to end a new document or element) |
protected 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) |
Expression | typeCheck(ExpressionVisitor visitor, ItemType contextItemType)
The typeCheck() method is called in XQuery, where node constructors
are implemented as Expressions. |
Parameters: data the supplied content context the dynamic context
Returns: the original content, unless adjustments are needed
Throws: XPathException if the content is invalid
Returns: the static cardinality
Returns: a set of flags indicating static properties of this expression
Parameters: context the XPath dynamic evaluation context
Returns: the name pool nameCode identifying the name of the constructed node
Throws: XPathException if any failure occurs
Parameters: context The dynamic context for the transformation
Returns: the value that will be used as the string value of the constructed node
Throws: XPathException if any error occurs
Returns: the select expression
Parameters: visitor an expression visitor contextItemType the static type of the context item
Throws: XPathException
Parameters: context the dynamic context of the transformation
Returns: a TailCall to be executed by the caller, always null for this instruction
Parameters: contextStack state a stack on which the instruction can save state information during the call on processLeft()
Parameters: contextStack state a stack on which the instruction can save state information during the call on processLeft()
Parameters: value the string value of the new node context the dynamic evaluation context
Throws: XPathException
Parameters: 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 expression
Throws: XPathException if any error is detected
Parameters: original the original subexpression replacement the replacement subexpression
Returns: true if the original subexpression is found
Parameters: select the expression that computes the string value of the node config the Saxon configuration (used for example to do early validation of the content of an attribute against the schema-defined type)
Throws: XPathException
Parameters: visitor an expression visitor
Returns: the rewritten expression
Throws: XPathException if any static errors are found in this expression or any of its children