Class DomSupport

java.lang.Object
org.codice.ddf.test.common.dom.DomSupport

public class DomSupport extends Object
This class provides support for handling DOM trees while testing.
  • Method Details

    • anyNodesInTheHierarchy

      public static Predicate<Node> anyNodesInTheHierarchy(Predicate<Node> predicate)
      Returns a new predicate that will report true if any of the nodes in the hierarchy of the tested node yields true when tested with the provided predicate.
      Parameters:
      predicate - the predicate to test with
      Returns:
      a new predicate that will test the given predicate against all nodes in the hierarchy of its tested node until one report true
    • anyNodeInTheHierarchyMatches

      public static boolean anyNodeInTheHierarchyMatches(Node node, Predicate<Node> predicate)
      Checks the given node's complete hierarchy (i.e. the node itself, its ancestors, and its lineage) to see if the provided predicate reports true for at least one node. This method will stop searching as soon as the predicate reports true for any node in the hierarchy.
      Parameters:
      node - the node to test the predicate against its hierarchy
      predicate - the predicate to test with
      Returns:
      true if the predicate reports true for at least one node; false otherwise
    • anyNodesInTheAncestryMatches

      public static boolean anyNodesInTheAncestryMatches(Node node, Predicate<Node> predicate)
      Checks the given node's ancestors to see if the provided predicate reports true for at least one node. This method will stop searching as soon as the predicate reports true for any node in the ancestry.
      Parameters:
      node - the node to test the predicate against its ancestry
      predicate - the predicate to test with
      Returns:
      true if the predicate reports true for at least one node; false otherwise
    • anyNodesInTheLineageMatches

      public static boolean anyNodesInTheLineageMatches(Node node, Predicate<Node> predicate)
      Checks the given node's descendants to see if the provided predicate reports true for at least one node. This method will stop searching as soon as the predicate reports true for any node in the lineage.
      Parameters:
      node - the node to test the predicate against its lineage
      predicate - the predicate to test with
      Returns:
      true if the predicate reports true for at least one node; false otherwise