Package net.sf.saxon.expr.instruct
Class ElementCreator
java.lang.Object
net.sf.saxon.expr.Expression
net.sf.saxon.expr.instruct.Instruction
net.sf.saxon.expr.instruct.ParentNodeConstructor
net.sf.saxon.expr.instruct.ElementCreator
- All Implemented Interfaces:
- ExportAgent,- InstructionWithComplexContent,- ValidatingInstruction,- Locatable,- IdentityComparable,- Traceable
- Direct Known Subclasses:
- ComputedElement,- Copy,- FixedElement
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.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classElementCreationDetails is a package of information and callbacks designed to parameterize the element construction process, to allow maximum use of common code for direct interpreted evaluation, elaborated evaluation, streamed evaluation, etc; supporting the variations that exist between computed element constructors, fixed element constructors, and shallow copy.
- 
Field SummaryFields inherited from class net.sf.saxon.expr.instruct.ParentNodeConstructorcontentOp, preservingTypesFields inherited from class net.sf.saxon.expr.ExpressionEFFECTIVE_BOOLEAN_VALUE, EVALUATE_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, MAX_COST, MAX_SEQUENCE_LENGTH, MAX_STRING_LENGTH, PROCESS_METHOD, staticProperties, UNBOUNDED_LOWER, UNBOUNDED_UPPER, UPDATE_METHOD, WATCH_METHOD
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidCheck statically whether the content of the element creates attributes or namespaces after creating any child nodesprotected intGet the static properties of this expression (other than its type).intDetermine the static cardinality of the expression.intAn implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process().Get the item type of the value returned by this instructionGet the (partial) name of a class that supports streaming of this kind of expressionbooleanAsk whether the inherit namespaces flag is setbooleanAsk whether this element inherits namespaces from its parent.abstract voidoutputNamespaceNodes(Outputter receiver, NodeName nodeName, ElementCreator.ElementCreationDetails details) Callback to output namespace bindings for the new element.voidsetBequeathNamespacesToChildren(boolean inherit) Say whether this element causes its children to inherit namespacesvoidsetInheritanceFlags(String flags) voidsetInheritNamespacesFromParent(boolean inherit) Say whether this element causes inherits namespaces from its parent.voidsuppressValidation(int parentValidationMode) Suppress validation on contained element constructors, on the grounds that the parent element is already performing validation.Methods inherited from class net.sf.saxon.expr.instruct.ParentNodeConstructoraddToPathMap, allowExtractingCommonSubexpressions, alwaysCreatesNewNodes, computeCardinality, getContentExpression, getContentOperand, getSchemaType, getValidationAction, getValidationOptions, isLocal, isPreservingTypes, mayCreateNewNodes, optimize, setContentExpression, setNoNeedToStrip, setValidationAction, setValidationOptions, typeCheckMethods inherited from class net.sf.saxon.expr.instruct.InstructionassembleParams, assembleTunnelParams, dynamicError, evaluateAsString, evaluateItem, getExpressionName, getInstructionNameCode, getNetCost, getSourceLocator, isInstruction, isXSLT, iterate, operands, process, someOperandCreatesNewNodesMethods inherited from class net.sf.saxon.expr.ExpressionadoptChildExpression, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeHashCode, computeStaticProperties, copy, dispatchTailCall, dynamicError, effectiveBooleanValue, equals, explain, export, getConfiguration, getCost, getDependencies, getElaborator, getEvaluationMethod, getExtraProperty, getIntegerBounds, getIntrinsicDependencies, getLocalRetainedStaticContext, getLocation, getObjectName, getPackageData, getParentExpression, getProperties, getProperty, getRetainedStaticContext, getScopingExpression, getSlotsUsed, getSpecialProperties, getStaticBaseURI, getStaticBaseURIString, getStaticType, getStaticUType, getTracingTag, hasCompatibleStaticContext, hashCode, hasSpecialProperty, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isCallOn, isEqual, isIdentical, isLiftable, isMultiThreaded, isStaticPropertiesKnown, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, makeElaborator, markTailFunctionCalls, operandList, operandSparseList, optimizeChildren, prepareForStreaming, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setExtraProperty, setFiltered, setFlattened, setLocation, setParentExpression, setRetainedStaticContext, setRetainedStaticContextLocally, setRetainedStaticContextThoroughly, setStaticProperty, simplify, simplifyChildren, staticTypeCheck, supportsLazyEvaluation, toPattern, toShortString, toString, typeCheckChildren, typeError, unordered, verifyParentPointers, withLocationMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.sf.saxon.trace.TraceablegatherProperties
- 
Constructor Details- 
ElementCreatorpublic ElementCreator()Construct an ElementCreator. Exists for the benefit of subclasses.
 
- 
- 
Method Details- 
getItemTypeGet the item type of the value returned by this instruction- Overrides:
- getItemTypein class- Instruction
- Returns:
- the item type
 
- 
getCardinalitypublic int getCardinality()Description copied from class:ExpressionDetermine the static cardinality of the expression. This establishes how many items there will be in the result of the expression, at compile time (i.e., without actually evaluating the result.- Overrides:
- getCardinalityin class- ParentNodeConstructor
- Returns:
- one of the values Cardinality.ONE_OR_MORE, Cardinality.ZERO_OR_MORE, Cardinality.EXACTLY_ONE, Cardinality.ZERO_OR_ONE, Cardinality.EMPTY. This default implementation returns ZERO_OR_MORE (which effectively gives no information).
 
- 
setBequeathNamespacesToChildrenpublic void setBequeathNamespacesToChildren(boolean inherit) Say whether this element causes its children to inherit namespaces- Parameters:
- inherit- true if namespaces are to be inherited by the children
 
- 
isBequeathNamespacesToChildrenpublic boolean isBequeathNamespacesToChildren()Ask whether the inherit namespaces flag is set- Returns:
- true if namespaces constructed on this parent element are to be inherited by its children
 
- 
setInheritNamespacesFromParentpublic void setInheritNamespacesFromParent(boolean inherit) Say whether this element causes inherits namespaces from its parent. True except in XQuery where one direct element constructor forms the immediate content of another (see W3C bug 22334)- Parameters:
- inherit- true if namespaces are to be inherited from the parent
 
- 
isInheritNamespacesFromParentpublic boolean isInheritNamespacesFromParent()Ask whether this element inherits namespaces from its parent. True except in XQuery where one direct element constructor forms the immediate content of another (see W3C bug 22334)- Returns:
- true if this child element inherits namespaces from its parent element
 
- 
computeSpecialPropertiesprotected int computeSpecialProperties()Get the static properties of this expression (other than its type). The result is bit-signficant. These properties are used for optimizations. In general, if property bit is set, it is true, but if it is unset, the value is unknown.- Overrides:
- computeSpecialPropertiesin class- Instruction
- Returns:
- a set of flags indicating static properties of this expression
 
- 
suppressValidationpublic void suppressValidation(int parentValidationMode) Suppress validation on contained element constructors, on the grounds that the parent element is already performing validation. The default implementation does nothing.- Overrides:
- suppressValidationin class- Expression
- Parameters:
- parentValidationMode- the kind of validation being performed on the parent expression
 
- 
checkContentSequenceCheck statically whether the content of the element creates attributes or namespaces after creating any child nodes- Specified by:
- checkContentSequencein class- ParentNodeConstructor
- Parameters:
- env- the static context
- Throws:
- XPathException- if the content is found to be incorrect
 
- 
outputNamespaceNodespublic abstract void outputNamespaceNodes(Outputter receiver, NodeName nodeName, ElementCreator.ElementCreationDetails details) throws XPathException Callback to output namespace bindings for the new element. This method is responsible for ensuring that a namespace binding is always generated for the namespace of the element name itself.- Parameters:
- receiver- the Outputter where the namespace bindings are to be written
- nodeName- the name of the element being created
- details- details supplied to the process() call
- Throws:
- XPathException- if a dynamic error occurs
 
- 
getImplementationMethodpublic int getImplementationMethod()An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process(). This method indicates which of these methods is prefered. For instructions this is the process() method.- Overrides:
- getImplementationMethodin class- Instruction
- Returns:
- the implementation method, for example Expression.ITERATE_METHODorExpression.EVALUATE_METHODorExpression.PROCESS_METHOD
 
- 
setInheritanceFlags
- 
makeElementCreationDetails
- 
getStreamerNameGet the (partial) name of a class that supports streaming of this kind of expression- Overrides:
- getStreamerNamein class- Expression
- Returns:
- the partial name of a class that can be instantiated to provide streaming support in Saxon-EE, or null if there is no such class
 
 
-