Package loci.poi.hssf.eventusermodel
Class HSSFRequest
- java.lang.Object
-
- loci.poi.hssf.eventusermodel.HSSFRequest
-
public class HSSFRequest extends Object
An HSSFRequest object should be constructed registering an instance or multiple instances of HSSFListener with each Record.sid you wish to listen for.- Author:
- Andrew C. Oliver (acoliver at apache dot org), Carey Sublette (careysub@earthling.net)
- See Also:
HSSFEventFactory
,HSSFListener
,loci.poi.hssf.dev.EFHSSF
,HSSFUserException
-
-
Constructor Summary
Constructors Constructor Description HSSFRequest()
Creates a new instance of HSSFRequest
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(HSSFListener lsnr, short sid)
add an event listener for a particular record type.void
addListenerForAllRecords(HSSFListener lsnr)
This is the equivilent of calling addListener(myListener, sid) for EVERY record in the loci.poi.hssf.record package.protected short
processRecord(Record rec)
Called by HSSFEventFactory, passes the Record to each listener associated with a record.sid.
-
-
-
Method Detail
-
addListener
public void addListener(HSSFListener lsnr, short sid)
add an event listener for a particular record type. The trick is you have to know what the records are for or just start with our examples and build on them. Alternatively, you CAN call addListenerForAllRecords and you'll recieve ALL record events in one listener, but if you like to squeeze every last byte of efficiency out of life you my not like this. (its sure as heck what I plan to do)- Parameters:
lsnr
- for the eventsid
- identifier for the record type this is the .sid static member on the individual records for example req.addListener(myListener, BOFRecord.sid)- See Also:
addListenerForAllRecords(HSSFListener)
-
addListenerForAllRecords
public void addListenerForAllRecords(HSSFListener lsnr)
This is the equivilent of calling addListener(myListener, sid) for EVERY record in the loci.poi.hssf.record package. This is for lazy people like me. You can call this more than once with more than one listener, but that seems like a bad thing to do from a practice-perspective unless you have a compelling reason to do so (like maybe you send the event two places or log it or something?).- Parameters:
lsnr
- a single listener to associate with ALL records
-
processRecord
protected short processRecord(Record rec) throws HSSFUserException
Called by HSSFEventFactory, passes the Record to each listener associated with a record.sid. Exception and return value added 2002-04-19 by Carey Sublette- Returns:
- numeric user-specified result code. If zero continue processing.
- Throws:
HSSFUserException
- User exception condition
-
-