Class NodeFilters


  • public final class NodeFilters
    extends java.lang.Object
    Common NodeFilter implementations.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static Predicate<org.w3c.dom.Node> AcceptAll
      Accepts all nodes.
      static Predicate<org.w3c.dom.Node> Default
      Suppresses document-type and XML declaration nodes.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private NodeFilters()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Predicate<org.w3c.dom.Node> satifiesAll​(Predicate<org.w3c.dom.Node>... predicates)
      Accepts nodes that are accepted by all given filters.
      static Predicate<org.w3c.dom.Node> satifiesAny​(Predicate<org.w3c.dom.Node>... predicates)
      Accepts nodes that are accepted by at least on of the given filters.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • AcceptAll

        public static final Predicate<org.w3c.dom.Node> AcceptAll
        Accepts all nodes.
        Since:
        XMLUnit 2.6.0
    • Constructor Detail

      • NodeFilters

        private NodeFilters()
    • Method Detail

      • satifiesAll

        public static Predicate<org.w3c.dom.Node> satifiesAll​(Predicate<org.w3c.dom.Node>... predicates)
        Accepts nodes that are accepted by all given filters.

        This short-circuits the given list of predicates and returns false as soon as the first predicate does.

        Parameters:
        predicates - predicates to test
        Returns:
        combined predicates
        Since:
        XMLUnit 2.9.0
      • satifiesAny

        public static Predicate<org.w3c.dom.Node> satifiesAny​(Predicate<org.w3c.dom.Node>... predicates)
        Accepts nodes that are accepted by at least on of the given filters.

        This short-circuits the given list of predicates and returns true as soon as the first predicate does.

        Parameters:
        predicates - predicates to test
        Returns:
        combined predicates
        Since:
        XMLUnit 2.9.0