|
|||||||
| 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, and their XQuery equivalents
| Field Summary |
|---|
| Fields inherited from class net.sf.saxon.expr.Expression |
|---|
EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD |
| Constructor Summary | |
|---|---|
SimpleNodeConstructor()
Default constructor used by subclasses |
|
| 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. |
Item |
evaluateItem(XPathContext context)
Evaluate as an expression. |
int |
evaluateNameCode(XPathContext context)
Run-time method to compute the name of the node being constructed. |
CharSequence |
expandChildren(XPathContext context)
Expand the stylesheet elements subordinate to this one, returning the result as a string. |
Expression |
getSelect()
Get the expression that determines the string value of the constructed node |
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(ExpressionVisitor visitor,
ItemType contextItemType)
Method to perform type-checking specific to the kind of instruction |
Expression |
optimize(ExpressionVisitor visitor,
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)
Set the select expression: the value of this expression determines the string-value of the node |
Expression |
simplify(ExpressionVisitor visitor)
Simplify an expression. |
Expression |
typeCheck(ExpressionVisitor visitor,
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 |
|---|
evaluateAsString, getImplementationMethod, getInstructionInfo, getInstructionNameCode, getItemType, getSourceLocator, isXSLT, process, processLeavingTail, promote |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, 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 XPathException
select - the expression that computes the string value of the nodeconfig - the Saxon configuration (used for example to do early validation of the content
of an attribute against the schema-defined type)
XPathExceptionpublic Expression getSelect()
public final boolean createsNewNodes()
createsNewNodes in class Instructionpublic int computeCardinality()
computeCardinality in class Instruction
public Expression simplify(ExpressionVisitor visitor)
throws XPathException
Instruction
simplify in class Instructionvisitor - an expression visitor
XPathException - if an error is discovered during expression
rewritingpublic int computeSpecialProperties()
computeSpecialProperties in class Instruction
public abstract void localTypeCheck(ExpressionVisitor visitor,
ItemType contextItemType)
throws XPathException
visitor - an expression visitorcontextItemType - the static type of the context item
XPathException
public Expression typeCheck(ExpressionVisitor visitor,
ItemType contextItemType)
throws XPathException
typeCheck in class Expressionvisitor - an expression visitorcontextItemType - 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 children
public Expression optimize(ExpressionVisitor visitor,
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.
optimize in class Expressionvisitor - an expression visitorcontextItemType - 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 an error is discovered during this phase
(typically a type error)public Iterator iterateSubExpressions()
Expression
iterateSubExpressions in class Expression
public boolean replaceSubExpression(Expression original,
Expression replacement)
replaceSubExpression in class Expressionoriginal - the original subexpressionreplacement - the replacement subexpression
public CharSequence expandChildren(XPathContext context)
throws XPathException
context - The dynamic context for the transformation
XPathException - if any error occurs
public Item evaluateItem(XPathContext context)
throws XPathException
evaluateItem in interface EvaluableItemevaluateItem in class Instructioncontext - The context in which the expression is to be evaluated
XPathException - if any dynamic error occurs evaluating the
expression
public int evaluateNameCode(XPathContext context)
throws XPathException
context - the XPath dynamic evaluation context
XPathException - if any failure occurs
public SequenceIterator iterate(XPathContext context)
throws XPathException
Instruction
iterate in interface SequenceIterableiterate in class Instructioncontext - supplies the context for evaluation
XPathException - if any dynamic error occurs evaluating the
expression
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||