Top Description Constructors Methods
org.apache.poi.hssf.eventusermodel

public Class HSSFEventFactory

extends Object
Class Inheritance
Imports
java.io.InputStream, .IOException, java.util.Set, org.apache.poi.hssf.record.*, org.apache.poi.poifs.filesystem.DirectoryNode, .POIFSFileSystem

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

AccessConstructor and Description
public
HSSFEventFactory()

Creates a new instance of HSSFEventFactory

Method Summary

Modifier and TypeMethod and Description
public short

Returns:

numeric user-specified result code.
abortableProcessEvents
(HSSFRequest
an Instance of HSSFRequest which has your registered listeners
req
,
InputStream
a DocumentInputStream obtained from POIFS's POIFSFileSystem object
in
)

Processes a DocumentInputStream into essentially Record events.

public short

Returns:

numeric user-specified result code.
abortableProcessWorkbookEvents
(HSSFRequest
an Instance of HSSFRequest which has your registered listeners
req
,
POIFSFileSystem
a POIFS filesystem containing your workbook
fs
)

Processes a file into essentially record events.

public short

Returns:

numeric user-specified result code.
abortableProcessWorkbookEvents
(HSSFRequest
an Instance of HSSFRequest which has your registered listeners
req
,
DirectoryNode
a DirectoryNode containing your workbook
dir
)

Processes a file into essentially record events.

private short

Returns:

numeric user-specified result code.
genericProcessEvents
(HSSFRequest
an Instance of HSSFRequest which has your registered listeners
req
,
InputStream
a DocumentInputStream obtained from POIFS's POIFSFileSystem object
in
)

Processes a DocumentInputStream into essentially Record events.

public void
processEvents(HSSFRequest
an Instance of HSSFRequest which has your registered listeners
req
,
InputStream
a DocumentInputStream obtained from POIFS's POIFSFileSystem object
in
)

Processes a DocumentInputStream into essentially Record events.

public void
processWorkbookEvents(HSSFRequest
an Instance of HSSFRequest which has your registered listeners
req
,
POIFSFileSystem
a POIFS filesystem containing your workbook
fs
)

Processes a file into essentially record events.

public void
processWorkbookEvents(HSSFRequest
an Instance of HSSFRequest which has your registered listeners
req
,
DirectoryNode
a DirectoryNode containing your workbook
dir
)

Processes a file into essentially record events.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

HSSFEventFactoryback to summary
public HSSFEventFactory()

Creates a new instance of HSSFEventFactory

Method Detail

abortableProcessEventsback to summary
public short abortableProcessEvents(HSSFRequest req, InputStream in) throws HSSFUserException

Processes a DocumentInputStream into essentially Record events.

Parameters
req:HSSFRequest

an Instance of HSSFRequest which has your registered listeners

in:InputStream

a DocumentInputStream obtained from POIFS's POIFSFileSystem object

Returns:short

numeric user-specified result code.

Exceptions
HSSFUserException:
if the processing should be aborted
See Also
org.apache.poi.poifs.filesystem.POIFSFileSystem#createDocumentInputStream(String)
abortableProcessWorkbookEventsback to summary
public short abortableProcessWorkbookEvents(HSSFRequest req, POIFSFileSystem fs) throws IOException, HSSFUserException

Processes a file into essentially record events.

Parameters
req:HSSFRequest

an Instance of HSSFRequest which has your registered listeners

fs:POIFSFileSystem

a POIFS filesystem containing your workbook

Returns:short

numeric user-specified result code.

Exceptions
IOException:
if the workbook contained errors
HSSFUserException:
if the processing should be aborted
abortableProcessWorkbookEventsback to summary
public short abortableProcessWorkbookEvents(HSSFRequest req, DirectoryNode dir) throws IOException, HSSFUserException

Processes a file into essentially record events.

Parameters
req:HSSFRequest

an Instance of HSSFRequest which has your registered listeners

dir:DirectoryNode

a DirectoryNode containing your workbook

Returns:short

numeric user-specified result code.

Exceptions
IOException:
if the workbook contained errors
HSSFUserException:
if the processing should be aborted
genericProcessEventsback to summary
private short genericProcessEvents(HSSFRequest req, InputStream in) throws HSSFUserException

Processes a DocumentInputStream into essentially Record events.

Parameters
req:HSSFRequest

an Instance of HSSFRequest which has your registered listeners

in:InputStream

a DocumentInputStream obtained from POIFS's POIFSFileSystem object

Returns:short

numeric user-specified result code.

See Also
org.apache.poi.poifs.filesystem.POIFSFileSystem#createDocumentInputStream(String)
processEventsback to summary
public void processEvents(HSSFRequest req, InputStream in)

Processes a DocumentInputStream into essentially Record events. If an AbortableHSSFListener causes a halt to processing during this call the method will return just as with abortableProcessEvents, but no user code or HSSFUserException will be passed back.

Parameters
req:HSSFRequest

an Instance of HSSFRequest which has your registered listeners

in:InputStream

a DocumentInputStream obtained from POIFS's POIFSFileSystem object

See Also
org.apache.poi.poifs.filesystem.POIFSFileSystem#createDocumentInputStream(String)
processWorkbookEventsback to summary
public void processWorkbookEvents(HSSFRequest req, POIFSFileSystem fs) throws IOException

Processes a file into essentially record events.

Parameters
req:HSSFRequest

an Instance of HSSFRequest which has your registered listeners

fs:POIFSFileSystem

a POIFS filesystem containing your workbook

Exceptions
IOException:
if the workbook contained errors
processWorkbookEventsback to summary
public void processWorkbookEvents(HSSFRequest req, DirectoryNode dir) throws IOException

Processes a file into essentially record events.

Parameters
req:HSSFRequest

an Instance of HSSFRequest which has your registered listeners

dir:DirectoryNode

a DirectoryNode containing your workbook

Exceptions
IOException:
if the workbook contained errors