Class ExcelStreamingSpreadSheetReader.SheetHandler

    • Field Detail

      • m_Sheet

        protected SpreadSheet m_Sheet
        the spreadsheet to add the content to.
      • m_SST

        protected org.apache.poi.xssf.model.SharedStringsTable m_SST
        the table for shared strings.
      • m_LastContents

        protected StringBuilder m_LastContents
        the assembled cell content.
      • m_ContentType

        protected Cell.ContentType m_ContentType
        what type the current cell is.
      • m_Reference

        protected String m_Reference
        the cell reference.
      • m_Stopped

        protected boolean m_Stopped
        whether the parsing was stopped.
      • m_UnknownCellTypes

        protected HashSet<String> m_UnknownCellTypes
        the unknown cell-type.
      • m_UnknownCellType

        protected String m_UnknownCellType
        the current unknown cell-types.
      • m_UnknownCellTypesExamples

        protected HashMap<String,​String> m_UnknownCellTypesExamples
        examples of the unknown cell-types (type - example).
      • m_UnknownCellStrings

        protected HashSet<String> m_UnknownCellStrings
        the unknown cell-strings.
      • m_UnknownCellString

        protected String m_UnknownCellString
        the current unknown cell-string.
      • m_UnknownCellStringsExamples

        protected HashMap<String,​String> m_UnknownCellStringsExamples
        examples of the unknown cell-strings (string - example).
      • m_LoggingAtLeastFine

        protected boolean m_LoggingAtLeastFine
        whether logging is at least fine.
      • m_TextColumns

        protected gnu.trove.set.hash.TIntHashSet m_TextColumns
        the text columns.
      • m_FirstRow

        protected int m_FirstRow
        the first row.
      • m_LastRow

        protected int m_LastRow
        the last row.
    • Constructor Detail

      • SheetHandler

        public SheetHandler​(ExcelStreamingSpreadSheetReader owner,
                            SpreadSheet sheet,
                            org.apache.poi.xssf.model.SharedStringsTable sst)
        Initializes the SAX handler.
        Parameters:
        owner - the reader this handler belongs to
        sheet - the spreadsheet to add the content to
        sst - the table for shared strings
    • Method Detail

      • startElement

        public void startElement​(String uri,
                                 String localName,
                                 String name,
                                 Attributes attributes)
                          throws SAXException
        Receive notification of the start of an element.
        Specified by:
        startElement in interface ContentHandler
        Overrides:
        startElement in class DefaultHandler
        Parameters:
        uri - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
        localName - The local name (without prefix), or the empty string if Namespace processing is not being performed.
        name - The qualified name (with prefix), or the empty string if qualified names are not available.
        attributes - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.
        Throws:
        SAXException - Any SAX exception, possibly wrapping another exception.
      • isInRange

        protected boolean isInRange​(int row)
        Checks whether the 0-based row is in the window that we want to read in.
        Parameters:
        row - the row to check
        Returns:
        true if inside the window
      • endElement

        public void endElement​(String uri,
                               String localName,
                               String name)
                        throws SAXException
        Receive notification of the end of an element.
        Specified by:
        endElement in interface ContentHandler
        Overrides:
        endElement in class DefaultHandler
        Parameters:
        uri - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
        localName - The local name (without prefix), or the empty string if Namespace processing is not being performed.
        name - The qualified name (with prefix), or the empty string if qualified names are not available.
        Throws:
        SAXException - Any SAX exception, possibly wrapping another exception.
      • characters

        public void characters​(char[] ch,
                               int start,
                               int length)
                        throws SAXException
        Receive notification of character data inside an element.

        By default, do nothing. Application writers may override this method to take specific actions for each chunk of character data (such as adding the data to a node or buffer, or printing it to a file).

        Specified by:
        characters in interface ContentHandler
        Overrides:
        characters in class DefaultHandler
        Parameters:
        ch - The characters.
        start - The start position in the character array.
        length - The number of characters to use from the character array.
        Throws:
        SAXException - Any SAX exception, possibly wrapping another exception.
      • stopExecution

        public void stopExecution()
        Stops the parsing.
        Specified by:
        stopExecution in interface Stoppable
      • getUnknownCellTypes

        public HashSet<String> getUnknownCellTypes()
        Returns the unknown cell types that were encountered.
        Returns:
        the cell types
      • getUnknownCellTypesExamples

        public HashMap<String,​String> getUnknownCellTypesExamples()
        Returns examples of the unknown cell types that were encountered.
        Returns:
        the examples
      • getUnknownCellStrings

        public HashSet<String> getUnknownCellStrings()
        Returns the unknown cell strings that were encountered.
        Returns:
        the cell strings
      • getUnknownCellStringsExamples

        public HashMap<String,​String> getUnknownCellStringsExamples()
        Returns examples of the unknown cell strings that were encountered.
        Returns:
        the examples