Class EventWorkbookBuilder
- java.lang.Object
-
- org.apache.poi.hssf.eventusermodel.EventWorkbookBuilder
-
public class EventWorkbookBuilder extends Object
When working with the EventUserModel, if you want to process formulas, you need an instance ofInternalWorkbook
to pass to aHSSFWorkbook
, to finally give toHSSFFormulaParser
, and this will build you stub ones. Since you're working with the EventUserModel, you wouldn't want to get a fullInternalWorkbook
andHSSFWorkbook
, as they would eat too much memory. Instead, you should collect a few key records as they go past, then call this once you have them to build a stubInternalWorkbook
, and from that a stubHSSFWorkbook
, to use with theHSSFFormulaParser
. The records you should collect are: *ExternSheetRecord
*BoundSheetRecord
You should probably also collectSSTRecord
, but it's not required to pass this in. To help, this class includes a HSSFListener wrapper that will do the collecting for you.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EventWorkbookBuilder.SheetRecordCollectingListener
A wrapping HSSFListener which will collectBoundSheetRecord
s andExternSheetRecord
s as they go past, so you can create a StubInternalWorkbook
from them once required.
-
Constructor Summary
Constructors Constructor Description EventWorkbookBuilder()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static InternalWorkbook
createStubWorkbook(ExternSheetRecord[] externs, BoundSheetRecord[] bounds)
Creates a stub workbook from the supplied records, suitable for use with theHSSFFormulaParser
static InternalWorkbook
createStubWorkbook(ExternSheetRecord[] externs, BoundSheetRecord[] bounds, SSTRecord sst)
Creates a stub Workbook from the supplied records, suitable for use with theHSSFFormulaParser
-
-
-
Method Detail
-
createStubWorkbook
public static InternalWorkbook createStubWorkbook(ExternSheetRecord[] externs, BoundSheetRecord[] bounds, SSTRecord sst)
Creates a stub Workbook from the supplied records, suitable for use with theHSSFFormulaParser
- Parameters:
externs
- The ExternSheetRecords in your filebounds
- The BoundSheetRecords in your filesst
- The SSTRecord in your file.- Returns:
- A stub Workbook suitable for use with
HSSFFormulaParser
-
createStubWorkbook
public static InternalWorkbook createStubWorkbook(ExternSheetRecord[] externs, BoundSheetRecord[] bounds)
Creates a stub workbook from the supplied records, suitable for use with theHSSFFormulaParser
- Parameters:
externs
- The ExternSheetRecords in your filebounds
- The BoundSheetRecords in your file- Returns:
- A stub Workbook suitable for use with
HSSFFormulaParser
-
-