Package org.xmlunit.diff
Class ChildNodeXPathContextProvider
- java.lang.Object
-
- org.xmlunit.diff.ChildNodeXPathContextProvider
-
- All Implemented Interfaces:
Mapper<org.w3c.dom.Node,XPathContext>
class ChildNodeXPathContextProvider extends java.lang.Object implements Mapper<org.w3c.dom.Node,XPathContext>
MapsNode
toXPathContext
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 Summary
Fields Modifier and Type Field Description private java.util.Map<org.w3c.dom.Node,java.lang.Integer>
childIndex
private XPathContext
xpathContext
-
Constructor Summary
Constructors Constructor Description ChildNodeXPathContextProvider(XPathContext parentContext, java.lang.Iterable<org.w3c.dom.Node> children)
Creates an instance of ChildNodeXPathContextProvider.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XPathContext
apply(org.w3c.dom.Node n)
-
-
-
Field Detail
-
xpathContext
private final XPathContext xpathContext
-
childIndex
private final java.util.Map<org.w3c.dom.Node,java.lang.Integer> childIndex
-
-
Constructor Detail
-
ChildNodeXPathContextProvider
ChildNodeXPathContextProvider(XPathContext parentContext, java.lang.Iterable<org.w3c.dom.Node> children)
Creates an instance of ChildNodeXPathContextProvider.- Parameters:
parentContext
- context of the parent of all Nodes ever expected to be passed in as arguments toapply(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 Detail
-
apply
public XPathContext apply(org.w3c.dom.Node n)
- Specified by:
apply
in interfaceMapper<org.w3c.dom.Node,XPathContext>
-
-