|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.saxon.expr.Expression
net.sf.saxon.instruct.Instruction
net.sf.saxon.instruct.SimpleNodeConstructor
public abstract class 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 |
---|
Fields inherited from class net.sf.saxon.expr.Expression |
---|
EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD |
Constructor Summary | |
---|---|
SimpleNodeConstructor()
|
Method Summary | |
---|---|
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. |
void |
display(int level,
PrintStream out,
Configuration config)
Display this instruction as an expression, for diagnostics |
Item |
evaluateItem(XPathContext context)
Evaluate as an expression. |
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)
Method to perform type-checking specific to the kind of instruction |
Expression |
optimize(Optimizer opt,
StaticContext env,
ItemType contextItemType)
Perform optimisation of an expression and its 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. |
Methods inherited from class net.sf.saxon.instruct.Instruction |
---|
appendItem, evaluateAsString, getImplementationMethod, getInstructionInfo, getInstructionNameCode, getItemType, getSourceLocator, isXSLT, process, processLeavingTail, promote |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.xml.transform.SourceLocator |
---|
getColumnNumber, getLineNumber, getPublicId, getSystemId |
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 int computeCardinality()
computeCardinality
in class Instruction
public Expression simplify(StaticContext env) throws XPathException
Instruction
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
env
- contextItemType
-
XPathException
public Expression typeCheck(StaticContext env, ItemType contextItemType) throws XPathException
typeCheck
in class Expression
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.
optimize
in class Expression
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()
Expression
iterateSubExpressions
in class Expression
public boolean replaceSubExpression(Expression original, Expression replacement)
replaceSubExpression
in interface Container
replaceSubExpression
in class Expression
original
- the original subexpressionreplacement
- the replacement subexpression
public CharSequence expandChildren(XPathContext context) throws XPathException
context
- The dynamic context for the transformation
XPathException
public Item evaluateItem(XPathContext context) throws XPathException
evaluateItem
in interface EvaluableItem
evaluateItem
in class Instruction
context
- The context in which the expression is to be evaluated
XPathException
- if any dynamic error occurs evaluating the
expressionpublic int evaluateNameCode(XPathContext context) throws XPathException, XPathException
XPathException
public SequenceIterator iterate(XPathContext context) throws XPathException
Instruction
iterate
in interface SequenceIterable
iterate
in class Instruction
context
- supplies the context for evaluation
XPathException
- if any dynamic error occurs evaluating the
expressionpublic void display(int level, PrintStream out, Configuration config)
display
in class Expression
level
- indentation level for this expressionout
- Output destination
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |