Class XlsxToListConverter
java.lang.Object
org.qubership.atp.dataset.service.direct.importexport.converters.XlsxToListConverter
A rudimentary XLSX -> ListMap processor modeled on the
POI sample program XlsxToListConverter from the package
org.apache.poi.hssf.eventusermodel.examples.
Read using a SAX parser to keep the
memory footprint relatively small, so this should be
able to read enormous workbooks. The styles table and
the shared-string table must be kept in memory. The
standard POI styles table class is used, but a custom
(read-only) class is used for the shared string table
because the standard POI SharedStringsTable grows very
quickly with the number of unique strings.
-
Constructor Summary
ConstructorsConstructorDescriptionXlsxToListConverter(org.apache.poi.openxml4j.opc.OPCPackage pkg, List<Map<Integer, String>> sheetConvertList) Creates a new XLSX -> ListMap converter. -
Method Summary
Modifier and TypeMethodDescriptionvoidprocess()Initiates the processing of the XLS workbook file to List.voidprocessSheet(org.apache.poi.xssf.model.Styles styles, org.apache.poi.xssf.model.SharedStrings strings, org.apache.poi.xssf.eventusermodel.XSSFSheetXMLHandler.SheetContentsHandler sheetHandler, InputStream sheetInputStream) Parses and shows the content of one sheet using the specified styles and shared-strings tables.
-
Constructor Details
-
XlsxToListConverter
public XlsxToListConverter(org.apache.poi.openxml4j.opc.OPCPackage pkg, List<Map<Integer, String>> sheetConvertList) Creates a new XLSX -> ListMap converter. output. The sheetConvertList to output the ListMap to.- Parameters:
pkg- The XLSX package to processsheetConvertList- The XLSX converted to ListMap
-
-
Method Details
-
process
public void process() throws IOException, org.apache.poi.openxml4j.exceptions.OpenXML4JException, SAXExceptionInitiates the processing of the XLS workbook file to List.- Throws:
IOException- If reading the data from the package fails.SAXException- if parsing the XML data fails.org.apache.poi.openxml4j.exceptions.OpenXML4JException