public abstract class SimpleNodeConstructor extends Instruction
Modifier and Type | Field and Description |
---|---|
protected Expression |
select |
locationId, staticProperties
EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD
Constructor and Description |
---|
SimpleNodeConstructor() |
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 |
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,
NamePool pool,
PrintStream out)
Display this instruction as an expression, for diagnostics
|
Item |
evaluateItem(XPathContext context)
Evaluate as an expression.
|
protected int |
evaluateNameCode(XPathContext context) |
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.
|
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.
|
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, promote
adoptChildExpression, checkPermittedContents, computeDependencies, computeStaticProperties, doPromotion, dynamicError, dynamicError, effectiveBooleanValue, getCardinality, getColumnNumber, getConstructType, getDependencies, getExecutable, getHostLanguage, getIntrinsicDependencies, getLineNumber, getLocationId, getLocationProvider, getParentExpression, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, hasBadParentPointer, markTailFunctionCalls, resetStaticProperties, setLocationId, setParentExpression, suppressValidation, typeError, typeError
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getColumnNumber, getLineNumber, getPublicId, getSystemId
protected Expression select
public void setSelect(Expression select, Configuration config) throws StaticError
StaticError
public Expression getSelect()
public final boolean createsNewNodes()
createsNewNodes
in class Instruction
public Expression simplify(StaticContext env) throws XPathException
Instruction
simplify
in interface Expression
simplify
in class Instruction
XPathException
- if an error is discovered during expression
rewritingpublic int computeSpecialProperties()
computeSpecialProperties
in class Instruction
public abstract void localTypeCheck(StaticContext env, ItemType contextItemType) throws XPathException
XPathException
public 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_TYPE
XPathException
- if any static errors are found in this expression
or any of its childrenpublic Expression optimize(Optimizer opt, StaticContext env, ItemType 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.
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_TYPE
StaticError
- if an error is discovered during this phase
(typically a type error)XPathException
public Iterator iterateSubExpressions()
ComputedExpression
iterateSubExpressions
in interface Expression
iterateSubExpressions
in class ComputedExpression
public CharSequence expandChildren(XPathContext context) throws XPathException
context
- The dynamic context for the transformationXPathException
public Item evaluateItem(XPathContext context) throws XPathException
evaluateItem
in interface Expression
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 DynamicError
data
- the supplied contentcontext
- the dynamic contextDynamicError
- if the content is invalidprotected int evaluateNameCode(XPathContext context) throws XPathException, XPathException
XPathException
public SequenceIterator iterate(XPathContext context) throws XPathException
Instruction
iterate
in interface Expression
iterate
in class Instruction
context
- supplies the context for evaluationXPathException
- if any dynamic error occurs evaluating the
expressionpublic void display(int level, NamePool pool, PrintStream out)
level
- indentation level for this expressionpool
- NamePool used to expand any names appearing in the expressionout
- Output destinationprotected 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 detected