|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.saxon.expr.ComputedExpression
net.sf.saxon.instruct.Instruction
net.sf.saxon.instruct.SimpleNodeConstructor
Common superclass for XSLT instructions whose content template produces a text value: xsl:attribute, xsl:comment, xsl:processing-instruction, xsl:namespace, and xsl:text
Field Summary | |
protected Expression |
select
|
Fields inherited from class net.sf.saxon.expr.ComputedExpression |
locationId, staticProperties |
Fields inherited from interface net.sf.saxon.expr.Expression |
EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD |
Constructor Summary | |
SimpleNodeConstructor()
|
Method Summary | |
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,
NamePool pool,
java.io.PrintStream out)
Display this instruction as an expression, for diagnostics |
Item |
evaluateItem(XPathContext context)
Evaluate as an expression. |
protected 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. |
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. |
Methods inherited from class net.sf.saxon.instruct.Instruction |
appendItem, assembleParams, assembleTunnelParams, computeCardinality, dynamicError, evaluateAsString, getImplementationMethod, getInstructionInfo, getInstructionNameCode, getItemType, getSourceLocator, isXSLT, process, processLeavingTail, promote |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.xml.transform.SourceLocator |
getColumnNumber, getLineNumber, getPublicId, getSystemId |
Field Detail |
protected Expression select
Constructor Detail |
public SimpleNodeConstructor()
Method Detail |
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
XPathException
public java.util.Iterator iterateSubExpressions()
ComputedExpression
iterateSubExpressions
in interface Expression
iterateSubExpressions
in class ComputedExpression
public java.lang.CharSequence expandChildren(XPathContext context) throws XPathException
context
- The dynamic context for the transformation
XPathException
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 evaluated
XPathException
- 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 context
DynamicError
- 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 evaluation
XPathException
- if any dynamic error occurs evaluating the
expressionpublic void display(int level, NamePool pool, java.io.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 expression
XPathException
- if any error is detected
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |