Interface XPathPatterns.Test

All Superinterfaces:
XPathPatterns.Operation
Enclosing class:
XPathPatterns
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface XPathPatterns.Test extends XPathPatterns.Operation
Representation of an XPath node test.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Motif<? extends Node,Node>
    Returns the motif associated with this navigation operation.
    of(Pattern<? super Node> test, String name)
    Returns a named implementation of this interface by the given pattern.
  • Method Details

    • getMotif

      Motif<? extends Node,Node> getMotif()
      Returns the motif associated with this navigation operation.

      Implementations of this interface should return motifs that match the hole against the target node if the test is true for that node, and fail otherwise.

      Specified by:
      getMotif in interface XPathPatterns.Operation
      Returns:
      a motif that matches the hole against navigation targets from the given context object.
    • of

      static XPathPatterns.Test of(Pattern<? super Node> test, String name)
      Returns a named implementation of this interface by the given pattern.

      The given name is displayed as the result of toString. If no name is required, a lambda expression can be used instead.

      Parameters:
      test - the pattern that specifies the test
      name - the user-readable name of the test
      Returns:
      A test implemented by a motif created from the pattern test
      Throws:
      NullPointerException - if test or name is null
      See Also: