Class ChildNodeXPathContextProvider

java.lang.Object
org.xmlunit.diff.ChildNodeXPathContextProvider
All Implemented Interfaces:
Mapper<Node,XPathContext>

class ChildNodeXPathContextProvider extends Object implements Mapper<Node,XPathContext>
Maps Node to XPathContext by assuming all nodes passed in are child nodes of the same parent node who's XPathContext is provided as argument to the constructor.
  • Field Details

  • Constructor Details

    • ChildNodeXPathContextProvider

      ChildNodeXPathContextProvider(XPathContext parentContext, Iterable<Node> children)
      Creates an instance of ChildNodeXPathContextProvider.
      Parameters:
      parentContext - context of the parent of all Nodes ever expected to be passed in as arguments to apply(org.w3c.dom.Node). This XPathContext must be "positioned at" the parent element and already know about all its children.
      children - all child nodes of the parent in the same order they are known to the XPathContext.
  • Method Details

    • apply

      public XPathContext apply(Node n)
      Description copied from interface: Mapper
      Performs the mapping operation.
      Specified by:
      apply in interface Mapper<Node,XPathContext>
      Parameters:
      n - the input to the mapping function
      Returns:
      the mapping result