Class STNodePredicate

java.lang.Object
io.nosqlbench.nb.spectest.traversal.STNodePredicate
All Implemented Interfaces:
Predicate<com.vladsch.flexmark.util.ast.Node>, Supplier<com.vladsch.flexmark.util.ast.Node>

public class STNodePredicate extends Object implements Predicate<com.vladsch.flexmark.util.ast.Node>, Supplier<com.vladsch.flexmark.util.ast.Node>

Construct a sequence of {com.vladsch.flexmark.util.ast.Node} matchers using one of a few common predicate forms, inferred from the types of the predicate formats provided.

The available forms are:

  1. A fully constructed Predicate of Node. When provided, this predicate is automatically checked against dummy data to ensure the generic signature is valid.
  2. A Class of any type of Node, which asserts that the node's class is equal to that specified. (No type hierarchy checks are allowed.)
  3. A fully compiled Pattern, which checks the textual content of the node for a match.
  4. A string, which is automatically promoted to a pattern as above, and checked in the same way. By default, patterns provided this way are automatically prefixed and suffixed with '.*' unless a regex character is found there. Also, all matches are created with Pattern.MULTILINE and Pattern.DOTALL.

  • Constructor Details

    • STNodePredicate

      public STNodePredicate(Object o)
  • Method Details

    • test

      public boolean test(com.vladsch.flexmark.util.ast.Node node)
      Specified by:
      test in interface Predicate<com.vladsch.flexmark.util.ast.Node>
    • get

      public com.vladsch.flexmark.util.ast.Node get()
      Specified by:
      get in interface Supplier<com.vladsch.flexmark.util.ast.Node>
    • toString

      public String toString()
      Overrides:
      toString in class Object