Class ChildNodeXPathContextProvider

  • All Implemented Interfaces:
    Mapper<org.w3c.dom.Node,​XPathContext>

    class ChildNodeXPathContextProvider
    extends java.lang.Object
    implements Mapper<org.w3c.dom.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.
    • 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)  
      • Methods inherited from class java.lang.Object

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

      • 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 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.