Class AbortableHSSFListener
- java.lang.Object
-
- org.apache.poi.hssf.eventusermodel.AbortableHSSFListener
-
- All Implemented Interfaces:
HSSFListener
public abstract class AbortableHSSFListener extends Object implements HSSFListener
Abstract class for use with the HSSFRequest and HSSFEventFactory, which allows for the halting of processing. Users should create subclass of this (which implements the usual HSSFListener), and then override the #abortableProcessRecord(Record) method to do their processing. This should then be registered with the HSSFRequest (associating it with Record SID's) as usual.- See Also:
HSSFEventFactory
,HSSFRequest
,HSSFUserException
-
-
Constructor Summary
Constructors Constructor Description AbortableHSSFListener()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract short
abortableProcessRecord(Record record)
Process an HSSF Record.void
processRecord(Record record)
This method, inherited from HSSFListener is implemented as a stub.
-
-
-
Method Detail
-
processRecord
public void processRecord(Record record)
This method, inherited from HSSFListener is implemented as a stub. It is never called by HSSFEventFactory or HSSFRequest. You should implement #abortableProcessRecord instead- Specified by:
processRecord
in interfaceHSSFListener
- Parameters:
record
- the record to be processed
-
abortableProcessRecord
public abstract short abortableProcessRecord(Record record) throws HSSFUserException
Process an HSSF Record. Called when a record occurs in an HSSF file. Provides two options for halting the processing of the HSSF file. The return value provides a means of non-error termination with a user-defined result code. A value of zero must be returned to continue processing, any other value will halt processing byHSSFEventFactory
with the code being passed back by its abortable process events methods. Error termination can be done by throwing the HSSFUserException. Note that HSSFEventFactory will not call the inherited process- Parameters:
record
- the record to be processed- Returns:
- result code of zero for continued processing.
- Throws:
HSSFUserException
- User code can throw this to abort file processing by HSSFEventFactory and return diagnostic information.
-
-