net.sf.saxon.instruct
public class SimpleContentConstructor extends Expression implements DivisibleInstruction
Field Summary | |
---|---|
boolean | isAtomic |
boolean | isSingleton |
Expression | select |
Expression | separator |
Constructor Summary | |
---|---|
SimpleContentConstructor(Expression select, Expression separator)
Create a SimpleContentConstructor |
Method Summary | |
---|---|
protected int | computeCardinality()
Compute the cardinality of the result of the expression. |
Expression | copy()
Copy an expression. |
Item | evaluateItem(XPathContext context)
Evaluate an expression as a single item. |
void | explain(ExpressionPresenter out)
Diagnostic print of expression structure. |
int | getImplementationMethod()
An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process().
|
ItemType | getItemType(TypeHierarchy th)
Determine the data type of the expression, if possible. |
Expression | getSelectExpression()
Get the select expression |
Expression | getSeparatorExpression()
Get the separator expression |
boolean | isAtomic()
Determine if the select expression is atomic |
boolean | isSingleton()
Determine whether the select expression is a singleton (an expression returning zero or one items) |
Iterator<Expression> | iterateSubExpressions()
Get the immediate sub-expressions of this expression. |
Expression | optimize(ExpressionVisitor visitor, ItemType contextItemType) |
void | process(XPathContext context, int locationId, int options)
Process the instruction, without returning any tail calls |
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) |
Expression | promote(PromotionOffer offer, Expression parent)
Offer promotion for this subexpression. |
boolean | replaceSubExpression(Expression original, Expression replacement)
Replace one subexpression by a replacement subexpression |
Expression | simplify(ExpressionVisitor visitor)
Simplify an expression. |
Expression | typeCheck(ExpressionVisitor visitor, ItemType contextItemType) |
Parameters: select the select expression (which computes a sequence of strings) separator the separator expression (which computes a value to separate adjacent strings)
Returns: the cardinality, @link {StaticProperty.EXACTLY_ONE}
Returns: the copy of the original expression
Parameters: context The context in which the expression is to be evaluated
Returns: the node or atomic value that results from evaluating the expression; or null to indicate that the result is an empty sequence
Throws: net.sf.saxon.trans.XPathException if any dynamic error occurs evaluating the expression
This method should always return a result, though it may be the best approximation that is available at the time.
Parameters: th the type hierarchy cache
Returns: a value such as Type.STRING, Type.BOOLEAN, Type.NUMBER, Type.NODE, or Type.ITEM (meaning not known at compile time)
Returns: the select expression
Returns: the separator expression
Returns: true if the select expression always returns atomic values
Returns: true if the select expression will always be of length zero or one
Returns: an iterator containing the sub-expressions of this expression
Parameters: context The dynamic context, giving access to the current node, the current variables, etc.
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: 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 parent
Returns: if the offer is not accepted, return this expression unchanged. Otherwise return the result of rewriting the expression to promote this subexpression
Throws: net.sf.saxon.trans.XPathException if any error is detected
Parameters: original the original subexpression replacement the replacement subexpression
Returns: true if the original subexpression is found
Parameters: visitor an expression visitor
Returns: the simplified expression
Throws: net.sf.saxon.trans.XPathException if an error is discovered during expression rewriting