public class ExcelRowByRowReader<T> extends AbstractReader<org.apache.poi.ss.usermodel.Row,T,Long>
FileInputStream straight into memory.Process.Event, Process.EventPoint| Modifier and Type | Field and Description |
|---|---|
protected int |
TIMEOUT_LOAD_IO_SECONDS
The time it should load the file in
|
protected Iterator<org.apache.poi.ss.usermodel.Row> |
worksheetRowIter |
exceptions, failFast, filter, hasNext, index, messages, params, paused, resource, transformerlisteners, processState| Constructor and Description |
|---|
ExcelRowByRowReader()
Default Constructor to allow lazy initialization
If so, init() must be called by the calling API explicitly after calling BaseIterativeProcessor.setResource(Resource) |
ExcelRowByRowReader(org.springframework.core.io.Resource resource) |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Un-initialize reader, so that it maybe re consumed
Except for the main Resource & configuration set by Spring context
all other instance variables used will be re-set/disposed/cleared. |
protected boolean |
filter(org.apache.poi.ss.usermodel.Row tuple)
A false will filter out the record, i.e.
|
Long |
getCurrentRawIndex(org.apache.poi.ss.usermodel.Row row)
Get the raw index/position on the source;
BaseIterativeProcessor.getCurrentIndex() only tracks the relevant position. |
Long |
getState()
Get current state of process
|
int |
getTIMEOUT_LOAD_IO_SECONDS()
The time it should load the file in
|
org.apache.poi.ss.usermodel.Sheet |
getWorksheet() |
int |
getWorksheetIndex()
One reader can be assigned to one worksheet.
|
boolean |
hasNext()
True if there is another record that can be read by the parser, false implies end of parse/read
|
void |
init()
Allow lazy initialization of Reader in cases where the resource may not be known @
PostConstruct time |
boolean |
isInitialized()
Allow the calling API to determine if the reader has been initialized via
RealTimeLineReader.init() or PostConstruct phase
If not RealTimeLineReader.init() should be called upon the instance. |
protected org.apache.poi.ss.usermodel.Row |
nextRecord() |
protected org.apache.poi.ss.usermodel.Workbook |
readBookTypeFromResource()
Determine the resource type, from extension XLS (HSSF format) or XLSX type Defaults to XSSF format (XSSF)
|
void |
resume() |
void |
resumeFromState(Long state)
Resume process from the given State provided
|
void |
setTIMEOUT_LOAD_IO_SECONDS(int tIMEOUT_LOAD_IO_SECONDS)
The time it should load the file in
|
void |
setWorksheetIndex(int worksheetIndex)
One reader can be assigned to one worksheet.
|
Long |
size()
Get number of tuples/records in resource
|
close, getCurrentIndex, getCurrentTupleIdentifier, getExceptions, getFilter, getId, getMessages, getMeta, getParams, getResource, getSourceLocation, getTransformer, handleMiscException, isFailFast, isPaused, kill, next, nextTupleResult, pause, remove, setExceptions, setFailFast, setFilter, setId, setMessages, setMeta, setParams, setResource, setTransformer, stop, transformaddListener, getListeners, onChangeHandler, setListenersclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingprotected transient Iterator<org.apache.poi.ss.usermodel.Row> worksheetRowIter
protected int TIMEOUT_LOAD_IO_SECONDS
public ExcelRowByRowReader(org.springframework.core.io.Resource resource)
public ExcelRowByRowReader()
init() must be called by the calling API explicitly after calling BaseIterativeProcessor.setResource(Resource)protected org.apache.poi.ss.usermodel.Workbook readBookTypeFromResource()
throws IOException
poiFs - as POIFSFileSystemIOException@PostConstruct public void init() throws IOException, Exception
RealTimeLineReaderPostConstruct timeinit in interface RealTimeLineReader<T>init in class BaseIterativeProcessor<org.apache.poi.ss.usermodel.Row,T,Long>ExceptionIOExceptionprotected boolean filter(org.apache.poi.ss.usermodel.Row tuple)
BaseIterativeProcessorfilter in class BaseIterativeProcessor<org.apache.poi.ss.usermodel.Row,T,Long>tuple - as public int getWorksheetIndex()
public void setWorksheetIndex(int worksheetIndex)
public void dispose()
RealTimeLineReaderResource & configuration set by Spring context
all other instance variables used will be re-set/disposed/cleared.public boolean isInitialized()
throws Exception
RealTimeLineReaderRealTimeLineReader.init() or PostConstruct phase
RealTimeLineReader.init() should be called upon the instance.Exceptionpublic boolean hasNext()
RealTimeLineReaderhasNext in interface RealTimeLineReader<T>hasNext in interface Iterator<T>hasNext in class BaseIterativeProcessor<org.apache.poi.ss.usermodel.Row,T,Long>public void resume()
throws Exception
resume in interface ControllableProcess<Long>resume in class BaseIterativeProcessor<org.apache.poi.ss.usermodel.Row,T,Long>Exceptionprotected org.apache.poi.ss.usermodel.Row nextRecord()
nextRecord in class BaseIterativeProcessor<org.apache.poi.ss.usermodel.Row,T,Long>public Long size()
ResourceAwareRealTimeLineReaderpublic void resumeFromState(Long state) throws Exception
ControllableProcessExceptionpublic Long getCurrentRawIndex(org.apache.poi.ss.usermodel.Row row)
BaseIterativeProcessorBaseIterativeProcessor.getCurrentIndex() only tracks the relevant position.
This method allows us to get the position on the source.
BaseIterativeProcessor.getCurrentIndex()getCurrentRawIndex in class BaseIterativeProcessor<org.apache.poi.ss.usermodel.Row,T,Long>public Long getState()
ControllableProcesspublic org.apache.poi.ss.usermodel.Sheet getWorksheet()
public int getTIMEOUT_LOAD_IO_SECONDS()
public void setTIMEOUT_LOAD_IO_SECONDS(int tIMEOUT_LOAD_IO_SECONDS)
Copyright © 2018. All rights reserved.