net.sf.saxon.instruct

Class ParentNodeConstructor

public abstract class ParentNodeConstructor extends Instruction

An abstract class to act as a common parent for instructions that create element nodes and document nodes.
Field Summary
protected Expressioncontent
intvalidation
Constructor Summary
ParentNodeConstructor()
Method Summary
booleancreatesNewNodes()
Determine whether this instruction creates new nodes.
intgetCardinality()
ExpressiongetContentExpression()
Get the expression that constructs the content of the element
SchemaTypegetSchemaType()
Get the schema type chosen for validation; null if not defined
intgetValidationAction()
Get the validation mode for this instruction
booleanisLazyConstruction()
Establish whether lazy construction is to be used
booleanisNamespaceSensitive()
Determine whether the schema type is namespace sensitive.
IteratoriterateSubExpressions()
Get the immediate sub-expressions of this expression.
Expressionoptimize(Optimizer opt, StaticContext env, ItemType contextItemType)
protected voidpromoteInst(PromotionOffer offer)
Handle promotion offers, that is, non-local tree rewrites.
voidsetContentExpression(Expression content)
Set the expression that constructs the content of the element
voidsetLazyConstruction(boolean lazy)
Indicate that lazy construction should (or should not) be used
voidsetSchemaType(SchemaType type)
Set the schema type to be used for validation
Expressionsimplify(StaticContext env)
Simplify an expression.
ExpressiontypeCheck(StaticContext env, ItemType contextItemType)
voidverifyLazyConstruction()
Check that lazy construction is possible for this element

Field Detail

content

protected Expression content

validation

int validation

Constructor Detail

ParentNodeConstructor

public ParentNodeConstructor()

Method Detail

createsNewNodes

public final boolean createsNewNodes()
Determine whether this instruction creates new nodes. This implementation returns true.

getCardinality

public int getCardinality()

getContentExpression

public Expression getContentExpression()
Get the expression that constructs the content of the element

getSchemaType

public SchemaType getSchemaType()
Get the schema type chosen for validation; null if not defined

getValidationAction

public int getValidationAction()
Get the validation mode for this instruction

Returns: the validation mode, for example STRICT or PRESERVE

isLazyConstruction

public final boolean isLazyConstruction()
Establish whether lazy construction is to be used

isNamespaceSensitive

public boolean isNamespaceSensitive()
Determine whether the schema type is namespace sensitive. The result is undefined if schemaType is null.

iterateSubExpressions

public Iterator iterateSubExpressions()
Get the immediate sub-expressions of this expression.

Returns: an iterator containing the sub-expressions of this expression

optimize

public Expression optimize(Optimizer opt, StaticContext env, ItemType contextItemType)

promoteInst

protected void promoteInst(PromotionOffer offer)
Handle promotion offers, that is, non-local tree rewrites.

Parameters: offer The type of rewrite being offered

Throws: net.sf.saxon.trans.XPathException

setContentExpression

public void setContentExpression(Expression content)
Set the expression that constructs the content of the element

setLazyConstruction

public void setLazyConstruction(boolean lazy)
Indicate that lazy construction should (or should not) be used

Parameters: lazy set to true if lazy construction should be used

setSchemaType

public void setSchemaType(SchemaType type)
Set the schema type to be used for validation

simplify

public Expression simplify(StaticContext env)
Simplify an expression. This performs any static optimization (by rewriting the expression as a different expression). The default implementation does nothing.

Returns: the simplified expression

Throws: net.sf.saxon.trans.XPathException if an error is discovered during expression rewriting

typeCheck

public Expression typeCheck(StaticContext env, ItemType contextItemType)

verifyLazyConstruction

void verifyLazyConstruction()
Check that lazy construction is possible for this element