public abstract class SimpleNodeConstructor extends Instruction
| Modifier and Type | Field and Description |
|---|---|
protected Expression |
select |
locationId, staticPropertiesEVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD| Constructor and Description |
|---|
SimpleNodeConstructor() |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
checkContent(java.lang.String data,
XPathContext context)
Check the content of the node, and adjust it if necessary.
|
int |
computeSpecialProperties()
Get the static properties of this expression (other than its type).
|
boolean |
createsNewNodes()
Determine whether this instruction creates new nodes.
|
void |
display(int level,
java.io.PrintStream out,
Configuration config)
Display this instruction as an expression, for diagnostics
|
Item |
evaluateItem(XPathContext context)
Evaluate as an expression.
|
int |
evaluateNameCode(XPathContext context) |
java.lang.CharSequence |
expandChildren(XPathContext context)
Expand the stylesheet elements subordinate to this one, returning the result
as a string.
|
Expression |
getSelect() |
SequenceIterator |
iterate(XPathContext context)
Return an Iterator to iterate over the values of a sequence.
|
java.util.Iterator |
iterateSubExpressions()
Get the immediate sub-expressions of this expression.
|
abstract void |
localTypeCheck(StaticContext env,
ItemType contextItemType) |
Expression |
optimize(Optimizer opt,
StaticContext env,
ItemType contextItemType)
Perform optimisation of an expression and its subexpressions.
|
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) |
Expression |
simplify(StaticContext env)
Simplify an expression.
|
Expression |
typeCheck(StaticContext env,
ItemType contextItemType)
The typeCheck() method is called in XQuery, where node constructors
are implemented as Expressions.
|
appendItem, assembleParams, assembleTunnelParams, computeCardinality, dynamicError, evaluateAsString, getImplementationMethod, getInstructionInfo, getInstructionNameCode, getItemType, getSourceLocator, isXSLT, process, processLeavingTail, promoteadoptChildExpression, checkPermittedContents, computeDependencies, computeStaticProperties, doPromotion, dynamicError, effectiveBooleanValue, getCardinality, getColumnNumber, getConstructType, getDependencies, getExecutable, getHostLanguage, getIntrinsicDependencies, getLineNumber, getLocationId, getLocationProvider, getParentExpression, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, hasBadParentPointer, markTailFunctionCalls, resetStaticProperties, setLocationId, setParentExpression, setParentExpression, suppressValidation, typeErrorprotected Expression select
public void setSelect(Expression select, Configuration config) throws StaticError
StaticErrorpublic Expression getSelect()
public final boolean createsNewNodes()
createsNewNodes in class Instructionpublic Expression simplify(StaticContext env) throws XPathException
Instructionsimplify in interface Expressionsimplify in class Instructionenv - the static contextXPathException - if an error is discovered during expression
rewritingpublic int computeSpecialProperties()
computeSpecialProperties in class Instructionpublic abstract void localTypeCheck(StaticContext env, ItemType contextItemType) throws XPathException
XPathExceptionpublic Expression typeCheck(StaticContext env, ItemType contextItemType) throws XPathException
env - The static context for the querycontextItemType - 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_TYPEXPathException - if any static errors are found in this expression
or any of its childrenpublic Expression optimize(Optimizer opt, StaticContext env, ItemType contextItemType) throws XPathException
ExpressionThis 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.
opt - the optimizer in use. This provides access to supporting functions; it also allows
different optimization strategies to be used in different circumstances.env - the static context of the expressioncontextItemType - 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_TYPEStaticError - if an error is discovered during this phase
(typically a type error)XPathExceptionpublic java.util.Iterator iterateSubExpressions()
ComputedExpressioniterateSubExpressions in interface ExpressioniterateSubExpressions in class ComputedExpressionpublic boolean replaceSubExpression(Expression original, Expression replacement)
replaceSubExpression in interface ContainerreplaceSubExpression in class ComputedExpressionoriginal - the original subexpressionreplacement - the replacement subexpressionpublic java.lang.CharSequence expandChildren(XPathContext context) throws XPathException
context - The dynamic context for the transformationXPathExceptionpublic Item evaluateItem(XPathContext context) throws XPathException
evaluateItem in interface ExpressionevaluateItem in class Instructioncontext - 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 DynamicError
data - the supplied contentcontext - the dynamic contextDynamicError - if the content is invalidpublic int evaluateNameCode(XPathContext context) throws XPathException, XPathException
XPathExceptionpublic SequenceIterator iterate(XPathContext context) throws XPathException
Instructioniterate in interface Expressioniterate in class Instructioncontext - supplies the context for evaluationXPathException - if any dynamic error occurs evaluating the
expressionpublic void display(int level,
java.io.PrintStream out,
Configuration config)
level - indentation level for this expressionout - Output destinationprotected void promoteInst(PromotionOffer offer) throws XPathException
promoteInst in class Instructionoffer - 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 detected