Class OuterForExpression

    • Constructor Detail

      • OuterForExpression

        public OuterForExpression()
    • Method Detail

      • getRangeVariableCardinality

        protected int getRangeVariableCardinality()
        Get the cardinality of the range variable
        Overrides:
        getRangeVariableCardinality in class ForExpression
        Returns:
        the cardinality of the range variable (StaticProperty.EXACTLY_ONE). in a subclass
      • optimize

        public Expression optimize​(ExpressionVisitor visitor,
                                   ContextItemStaticInfo contextItemType)
                            throws XPathException
        Optimize the expression
        Overrides:
        optimize in class ForExpression
        Parameters:
        visitor - an expression visitor
        contextItemType - 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
        Returns:
        the original expression, rewritten if appropriate to optimize execution
        Throws:
        XPathException - if an error is discovered during this phase (typically a type error)
      • copy

        public Expression copy​(RebindingMap rebindings)
        Copy an expression. This makes a deep copy.
        Overrides:
        copy in class ForExpression
        Parameters:
        rebindings - the rebinding map
        Returns:
        the copy of the original expression
      • iterate

        public SequenceIterator iterate​(XPathContext context)
                                 throws XPathException
        Iterate over the result of the expression
        Overrides:
        iterate in class ForExpression
        Parameters:
        context - supplies the context for evaluation
        Returns:
        a SequenceIterator that can be used to iterate over the result of the expression
        Throws:
        XPathException - if any dynamic error occurs evaluating the expression
      • process

        public void process​(Outputter output,
                            XPathContext context)
                     throws XPathException
        Process this expression as an instruction, writing results to the current outputter
        Overrides:
        process in class ForExpression
        Parameters:
        output - the destination for the result
        context - The dynamic context, giving access to the current node, the current variables, etc.
        Throws:
        XPathException - if a dynamic error occurs
      • getExpressionName

        public java.lang.String getExpressionName()
        Get a name identifying the kind of expression, in terms meaningful to a user.
        Overrides:
        getExpressionName in class ForExpression
        Returns:
        a name identifying the kind of expression, in terms meaningful to a user. The name will always be in the form of a lexical XML QName, and should match the name used in explain() output displaying the expression.
      • evaluatePendingUpdates

        public void evaluatePendingUpdates​(XPathContext context,
                                           PendingUpdateList pul)
                                    throws XPathException
        Evaluate an updating expression, adding the results to a Pending Update List. The default implementation of this method, which is used for non-updating expressions, throws an UnsupportedOperationException
        Overrides:
        evaluatePendingUpdates in class ForExpression
        Parameters:
        context - the XPath dynamic evaluation context
        pul - the pending update list to which the results should be written
        Throws:
        XPathException - if evaluation fails