Class CollectionPopulatingXMLStreamProcessor

    • Constructor Detail

      • CollectionPopulatingXMLStreamProcessor

        public CollectionPopulatingXMLStreamProcessor​(java.util.Collection<Fragment> collection)
        Parameters:
        collection - the Collection to be populated
    • Method Detail

      • process

        public void process​(Fragment fragment)
        Called by the StreamingXMLReader as each node is extracted from the file

        Adds the Fragment to the collection set via the c onstructor and updates the bytes read and number of items processed

        Specified by:
        process in interface XMLStreamProcessor
        Parameters:
        fragment - Wrapper object that contains a DocumentFragment and an XMLByteLocation object
      • setBytesTotal

        public void setBytesTotal​(long bytesTotal)
        Called by the StreamingXMLReader when the reading starts
        Specified by:
        setBytesTotal in interface XMLStreamProcessor
        Parameters:
        bytesTotal - The total number of bytes in the file being processed
      • getBytesRemaining

        public long getBytesRemaining()
        Returns:
        The number of bytes left to process
      • getBytesTotal

        public long getBytesTotal()
        Returns:
        Total number of bytes in the XML file being parsed, as set by the StreamingXMLReader
      • getBytesRead

        public long getBytesRead()
        Returns:
        Number of bytes that have been read by the StreamingXMLReader
      • getNumProcessed

        public int getNumProcessed()
        Returns:
        The number of nodes processed. Updated as each node is extracted