Skip navigation links
com.eibus.xml.xpath

Class XPathReader

    • Method Detail

      • getResourceOwner

        public ResourceOwner getResourceOwner()
        Deprecated. 
        This method is used for internal purposes.
      • getXPathReader

        public static XPathReader getXPathReader(XPath xpath,
                                                 XPathMetaInfo meta,
                                                 Document doc,
                                                 java.lang.String uri)
        Creates the XPathReader instance for URI.
        Parameters:
        xpath - The XPath object for identifying the pattern
        meta - The XPath meta information
        doc - The NOM Document required for parsing the target/selected XML content
        uri - The source xml location
        Returns:
        The XPathReader instance or null if the input data is invalid.
      • getXPathReaderFromStream

        public static XPathReader getXPathReaderFromStream(XPath xpath,
                                                           XPathMetaInfo meta,
                                                           Document doc,
                                                           java.io.InputStream input)
        Creates the XPathReader instance for the InputStream
        Parameters:
        xpath - The XPath object for identifying the pattern
        meta - The XPath meta information
        doc - The NOM Document required for parsing the target/selected XML content
        inputStream - The InputStream object representing the source xml.
        Returns:
        The XPathReader instance or null if the input data is invalid.
      • open

        public boolean open()
        Opens the XPathReader for processing.
        Returns:
        True if the reader open is success, otherwise it returns false
      • getNextMatch

        public NodeSet getNextMatch()
        Deprecated. , please use 'loadNextNode' and 'getNextMatchInLoadedNode'
        Returns the next matched XML content as a nodeset
        Returns:
        Returns the next matched XML as a NodeSet
      • getNextNode

        public int getNextNode()
        Deprecated. , please use 'loadNextNode' and 'getNextMatchInLoadedNode'
        Returns the next node of the XPath match The returned node is for consumption only. Consumers should not alter the returned node. Consumers have to duplicate the returned node if they want to persist it
        Returns:
        Returns the next matched NOM node
      • close

        public boolean close()
        Closes the XPathReader.
        Returns:
        True if the reader close is success, otherwise it returns false
      • loadNextNode

        public int loadNextNode()
        Loads the next NOM node from the stream. The loaded node will be an orphan node. The loaded node may contain other node which also matches the pattern.
        Returns:
        - The loaded NOM node
        See Also:
        getNextMatchInLoadedNode()
      • getNextMatchInLoadedNode

        public int getNextMatchInLoadedNode()
        Return the next matching node in the loaded NOM tree returned by loadNextNode() method.
        Returns:
        next match NOM node in the node loaded