Class PatternWithPredicate

    • Constructor Detail

      • PatternWithPredicate

        public PatternWithPredicate​(Pattern basePattern,
                                    Expression predicate)
    • Method Detail

      • 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 a dynamic error occurs during pattern matching
      • getItemType

        public ItemType getItemType()
        Get an ItemType that all the items matching this pattern must satisfy
        Specified by:
        getItemType in class Pattern
        Returns:
        an ItemType, as specific as possible, which all the matching items satisfy
      • iterateSubExpressions

        public java.util.Iterator iterateSubExpressions()
        Iterate over the subexpressions within this pattern
        Overrides:
        iterateSubExpressions in class Pattern
        Returns:
        an iterator over the subexpressions. Default implementation returns an empty sequence
      • getDefaultPriority

        public double getDefaultPriority()
        Determine the default priority to use if this pattern appears as a match pattern for a template with no explicit priority attribute.
        Overrides:
        getDefaultPriority in class Pattern
        Returns:
        the default priority for the pattern