|
||||||||||
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.ElementCreator
An instruction that creates an element node. There are two subtypes, FixedElement for use where the name is known statically, and Element where it is computed dynamically. To allow use in both XSLT and XQuery, the class acts both as an Instruction and as an Expression.
Field Summary | |
protected Expression |
content
|
protected boolean |
inheritNamespaces
The inheritNamespaces flag indicates that the namespace nodes on the element created by this instruction are to be inherited (copied) on the children of this element. |
protected SchemaType |
schemaType
|
protected AttributeSet[] |
useAttributeSets
|
protected int |
validation
|
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 | |
ElementCreator()
|
Method Summary | |
Expression |
analyze(StaticContext env,
ItemType contextItemType)
Perform static analysis of an expression and its subexpressions. |
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 |
getCardinality()
Determine the static cardinality of the expression. |
int |
getImplementationMethod()
An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process(). |
ItemType |
getItemType()
Get the item type of the value returned by this instruction |
protected abstract int |
getNameCode(XPathContext context)
|
int |
getValidationMode()
Get the validation mode for the constructed element |
java.util.Iterator |
iterateSubExpressions()
Get the immediate sub-expressions of this expression. |
protected abstract void |
outputNamespaceNodes(XPathContext context,
Receiver receiver)
Callback to output namespace nodes for the new element. |
TailCall |
processLeavingTail(XPathContext context)
Evaluate the instruction to produce a new element node |
protected void |
promoteInst(PromotionOffer offer)
Handle promotion offers, that is, non-local tree rewrites. |
void |
setContent(Expression content)
Set the expression that constructs the content of the element |
void |
setValidationMode(int mode)
Set the validation mode for the new element |
Expression |
simplify(StaticContext env)
Simplify an expression. |
Methods inherited from class net.sf.saxon.instruct.Instruction |
appendItem, assembleParams, assembleTunnelParams, computeCardinality, dynamicError, dynamicError, effectiveBooleanValue, evaluateAsString, getInstructionInfo, getInstructionNameCode, getSourceLocator, isXSLT, iterate, process, 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 |
Methods inherited from interface net.sf.saxon.expr.Expression |
display |
Field Detail |
protected Expression content
protected AttributeSet[] useAttributeSets
protected SchemaType schemaType
protected int validation
protected boolean inheritNamespaces
Constructor Detail |
public ElementCreator()
Method Detail |
public void setContent(Expression content)
public Expression simplify(StaticContext env) throws XPathException
simplify
in interface Expression
simplify
in class Instruction
XPathException
- if an error is discovered during expression rewritingpublic Expression analyze(StaticContext env, ItemType contextItemType) throws XPathException
This checks statically that the operands of the expression have the correct type; if necessary it generates code to do run-time type checking or type conversion. A static type error is reported only if execution cannot possibly succeed, that is, if a run-time type error is inevitable. The call may return a modified form of the expression.
This method is called after all references to functions and variables have been resolved to the declaration of the function or variable. However, the types of such functions and variables will only be accurately known if they have been explicitly declared.
analyze
in interface Expression
analyze
in class Instruction
env
- the static context of the expression
XPathException
- if an error is discovered during this phase
(typically a type error)protected void promoteInst(PromotionOffer offer) throws XPathException
promoteInst
in class Instruction
offer
- The type of rewrite being offered
XPathException
public java.util.Iterator iterateSubExpressions()
iterateSubExpressions
in interface Expression
iterateSubExpressions
in class ComputedExpression
public final boolean createsNewNodes()
createsNewNodes
in class Instruction
public ItemType getItemType()
getItemType
in interface Expression
getItemType
in class Instruction
public int getCardinality()
ComputedExpression
getCardinality
in interface Expression
getCardinality
in class ComputedExpression
public int computeSpecialProperties()
computeSpecialProperties
in class Instruction
public void setValidationMode(int mode)
public int getValidationMode()
protected abstract int getNameCode(XPathContext context) throws XPathException
XPathException
protected abstract void outputNamespaceNodes(XPathContext context, Receiver receiver) throws XPathException
context
- The execution contextreceiver
- the Receiver where the namespace nodes are to be written
XPathException
public int getImplementationMethod()
getImplementationMethod
in interface Expression
getImplementationMethod
in class Instruction
public TailCall processLeavingTail(XPathContext context) throws XPathException
processLeavingTail
in class Instruction
context
-
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
expression
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |