Class StreamingFunctionArgumentPattern

  • All Implemented Interfaces:
    ExportAgent, Locatable, IdentityComparable, Traceable

    public class StreamingFunctionArgumentPattern
    extends Pattern
    This is a special pattern that matches the node supplied as the first argument of a call to a streamable stylesheet function; it corresponds to the pattern match="$arg" where $arg is the first argument of the function.
    • Constructor Detail

      • StreamingFunctionArgumentPattern

        protected StreamingFunctionArgumentPattern()
    • Method Detail

      • getUType

        public UType getUType()
        Get a UType indicating which kinds of items this Pattern can match.
        Specified by:
        getUType in class Pattern
        Returns:
        a UType indicating all the primitive types of item that the pattern can match.
      • typeCheck

        public Pattern typeCheck​(ExpressionVisitor visitor,
                                 ContextItemStaticInfo contextItemType)
                          throws XPathException
        Type-check the pattern.
        Overrides:
        typeCheck in class Pattern
        Parameters:
        visitor - the expression visitor
        contextItemType - the type of the context item at the point where the pattern is defined. Set to null if it is known that the context item is undefined.
        Returns:
        the optimised Pattern
        Throws:
        XPathException - if an error is discovered during this phase (typically a type error)
      • matches

        public boolean matches​(Item item,
                               XPathContext context)
                        throws XPathException
        Determine whether this Pattern matches the given Node. This is the main external interface for matching patterns: it sets current() to the node being tested
        Specified by:
        matches in class Pattern
        Parameters:
        item - The NodeInfo representing the Element or other node to be tested against the Pattern
        context - The dynamic context. Only relevant if the pattern uses variables, or contains calls on functions such as document() or key().
        Returns:
        true if the node matches the Pattern, false otherwise
        Throws:
        XPathException - if an error occurs while matching the pattern (the caller will usually treat this the same as a false result)
      • getItemType

        public ItemType getItemType()
        Get a NodeTest that all the nodes matching this pattern must satisfy
        Specified by:
        getItemType in class Pattern
        Returns:
        a NodeTest, as specific as possible, which all the matching nodes satisfy
      • reconstruct

        public java.lang.String reconstruct()
        Description copied from class: Pattern
        Reconstruct a string representation of the pattern from its compiled form, in cases where the original text is not available
        Overrides:
        reconstruct in class Pattern
      • export

        public void export​(ExpressionPresenter presenter)
                    throws XPathException
        Description copied from class: Expression
        Diagnostic print of expression structure. The abstract expression tree is written to the supplied output destination.
        Specified by:
        export in interface ExportAgent
        Specified by:
        export in class Pattern
        Parameters:
        presenter - the expression presenter used to display the structure
        Throws:
        XPathException - if the export fails, for example if an expression is found that won't work in the target environment.
      • copy

        public Pattern copy​(RebindingMap rebindings)
        Copy the pattern. Since there is only one, return the same.
        Specified by:
        copy in class Pattern
        Parameters:
        rebindings - variables that need to be rebound
        Returns:
        the original pattern unchanged