T - the typepublic class PoiItemReader<T> extends AbstractExcelItemReader<T>
ItemReader implementation which uses apache POI
to read an Excel file. It will read the file sheet for sheet and row for row. It is
based on the FlatFileItemReaderlogger| Constructor and Description |
|---|
PoiItemReader() |
PoiItemReader(boolean useDefaultCellType) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doClose() |
protected int |
getNumberOfSheets()
The number of sheets in the underlying workbook.
|
protected Sheet |
getSheet(int sheet) |
protected void |
openExcelFile(java.io.InputStream inputStream)
Open the underlying file using the
WorkbookFactory. |
afterPropertiesSet, doOpen, doRead, jumpToItem, read, setEndAfterBlankLines, setLinesToSkip, setResource, setRowMapper, setRowSetFactory, setSkippedRowsCallback, setStrictclose, getCurrentItemCount, isSaveState, open, setCurrentItemCount, setMaxItemCount, setSaveState, updategetExecutionContextKey, setExecutionContextName, setNamepublic PoiItemReader()
public PoiItemReader(boolean useDefaultCellType)
protected Sheet getSheet(int sheet)
getSheet in class AbstractExcelItemReader<T>sheet - the sheet indexnull when no sheet available.protected int getNumberOfSheets()
AbstractExcelItemReadergetNumberOfSheets in class AbstractExcelItemReader<T>protected void doClose()
throws java.lang.Exception
doClose in class AbstractExcelItemReader<T>java.lang.Exceptionprotected void openExcelFile(java.io.InputStream inputStream)
throws java.lang.Exception
WorkbookFactory. We keep track of the used InputStream so that
it can be closed cleanly on the end of reading the file. This to be able to release the resources used by
Apache POI.openExcelFile in class AbstractExcelItemReader<T>inputStream - the InputStream pointing to the Excel file.java.lang.Exception - is thrown for any errors.