Class ElementCreator

    • Field Detail

      • inheritNamespaces

        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. That is, if this flag is false, the child elements must carry a namespace undeclaration for all the namespaces on the parent, unless they are redeclared in some way.
      • validating

        protected boolean validating
        The validating flag is set if the type attribute is set or if validation is set to anything other than preserve. This is used simply to fast-path the case where no validation is required.
    • Constructor Detail

      • ElementCreator

        public ElementCreator()
    • Method Detail

      • isValidating

        public boolean isValidating()
        Determine whether this elementCreator performs validation
      • isInheritNamespaces

        public boolean isInheritNamespaces()
        Determine whether the inherit namespaces flag is set
      • computeSpecialProperties

        public 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:
        computeSpecialProperties in class Instruction
        Returns:
        a set of flags indicating static properties of this expression
      • setValidationMode

        public void setValidationMode​(int mode)
        Set the validation mode for the new element
      • getValidationMode

        public int getValidationMode()
        Get the validation mode for the constructed element
      • suppressValidation

        public void suppressValidation​(int validationMode)
        Suppress validation on contained element constructors, on the grounds that the parent element is already performing validation. The default implementation does nothing.
        Overrides:
        suppressValidation in class ComputedExpression
      • getNewBaseURI

        public abstract java.lang.String getNewBaseURI​(XPathContext context)
        Get the base URI for the element being constructed
        Parameters:
        context -
      • outputNamespaceNodes

        protected abstract void outputNamespaceNodes​(XPathContext context,
                                                     Receiver receiver)
                                              throws XPathException
        Callback to output namespace nodes for the new element.
        Parameters:
        context - The execution context
        receiver - the Receiver where the namespace nodes are to be written
        Throws:
        XPathException
      • getActiveNamespaces

        public int[] getActiveNamespaces()
                                  throws XPathException
        Callback to get a list of the intrinsic namespaces that need to be generated for the element. The result is an array of namespace codes, the codes either occupy the whole array or are terminated by a -1 entry. A result of null is equivalent to a zero-length array.
        Throws:
        XPathException
      • getImplementationMethod

        public 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.
        Specified by:
        getImplementationMethod in interface Expression
        Overrides:
        getImplementationMethod in class Instruction
      • evaluateItem

        public Item evaluateItem​(XPathContext context)
                          throws XPathException
        Evaluate the constructor, returning the constructed element node. If lazy construction mode is in effect, then an UnconstructedParent object is returned instead.
        Specified by:
        evaluateItem in interface Expression
        Overrides:
        evaluateItem in class Instruction
        Parameters:
        context - The context in which the expression is to be evaluated
        Returns:
        the node or atomic value that results from evaluating the expression; or null to indicate that the result is an empty sequence
        Throws:
        XPathException - if any dynamic error occurs evaluating the expression