Class HSSFEventFactory
java.lang.Object
org.apache.poi.hssf.eventusermodel.HSSFEventFactory
Low level event based HSSF reader. Pass either a DocumentInputStream to
process events along with a request object or pass a POIFS POIFSFileSystem to
processWorkbookEvents along with a request.
This will cause your file to be processed a record at a time. Each record with
a static id matching one that you have registered in your HSSFRequest will be passed
to your associated HSSFListener.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionshort
abortableProcessEvents
(HSSFRequest req, InputStream in) Processes a DocumentInputStream into essentially Record events.short
Processes a file into essentially record events.short
Processes a file into essentially record events.void
processEvents
(HSSFRequest req, InputStream in) Processes a DocumentInputStream into essentially Record events.void
processWorkbookEvents
(HSSFRequest req, DirectoryNode dir) Processes a file into essentially record events.void
Processes a file into essentially record events.
-
Constructor Details
-
HSSFEventFactory
public HSSFEventFactory()Creates a new instance of HSSFEventFactory
-
-
Method Details
-
processWorkbookEvents
Processes a file into essentially record events.- Parameters:
req
- an Instance of HSSFRequest which has your registered listenersfs
- a POIFS filesystem containing your workbook- Throws:
IOException
- if the workbook contained errors
-
processWorkbookEvents
Processes a file into essentially record events.- Parameters:
req
- an Instance of HSSFRequest which has your registered listenersdir
- a DirectoryNode containing your workbook- Throws:
IOException
- if the workbook contained errors
-
abortableProcessWorkbookEvents
public short abortableProcessWorkbookEvents(HSSFRequest req, POIFSFileSystem fs) throws IOException, HSSFUserException Processes a file into essentially record events.- Parameters:
req
- an Instance of HSSFRequest which has your registered listenersfs
- a POIFS filesystem containing your workbook- Returns:
- numeric user-specified result code.
- Throws:
HSSFUserException
- if the processing should be abortedIOException
- if the workbook contained errors
-
abortableProcessWorkbookEvents
public short abortableProcessWorkbookEvents(HSSFRequest req, DirectoryNode dir) throws IOException, HSSFUserException Processes a file into essentially record events.- Parameters:
req
- an Instance of HSSFRequest which has your registered listenersdir
- a DirectoryNode containing your workbook- Returns:
- numeric user-specified result code.
- Throws:
HSSFUserException
- if the processing should be abortedIOException
- if the workbook contained errors
-
processEvents
Processes a DocumentInputStream into essentially Record events. If anAbortableHSSFListener
causes a halt to processing during this call the method will return just as withabortableProcessEvents
, but no user code orHSSFUserException
will be passed back.- Parameters:
req
- an Instance of HSSFRequest which has your registered listenersin
- a DocumentInputStream obtained from POIFS's POIFSFileSystem object- See Also:
-
abortableProcessEvents
Processes a DocumentInputStream into essentially Record events.- Parameters:
req
- an Instance of HSSFRequest which has your registered listenersin
- a DocumentInputStream obtained from POIFS's POIFSFileSystem object- Returns:
- numeric user-specified result code.
- Throws:
HSSFUserException
- if the processing should be aborted- See Also:
-