public class EventWorkbookBuilder
extends java.lang.Object
InternalWorkbook
to pass to a
HSSFWorkbook
, to finally give to
HSSFFormulaParser
, and this will build you stub ones. Since you're working with the EventUserModel, you wouldn't want to get a full
InternalWorkbook
and
HSSFWorkbook
, 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 stub
InternalWorkbook
, and from that a stub
HSSFWorkbook
, to use with the
HSSFFormulaParser
. The records you should collect are: *
ExternSheetRecord
*
BoundSheetRecord
You should probably also collect
SSTRecord
, but it's not required to pass this in. To help, this class includes a HSSFListener wrapper that will do the collecting for you.
(使用 EventUserModel 时,如果要处理公式,则需要将 InternalWorkbook 的实例传递给 HSSFWorkbook,最终提供给 HSSFFormulaParser,这将为您构建存根。由于您使用的是 EventUserModel,因此您不希望获得完整的 InternalWorkbook 和 HSSFWorkbook,因为它们会占用太多内存。相反,您应该在它们过去时收集一些关键记录,然后在拥有它们后调用它来构建存根 InternalWorkbook,并从中构建存根 HSSFWorkbook,以与 HSSFFormulaParser 一起使用。您应该收集的记录是: * ExternSheetRecord * BoundSheetRecord 您可能还应该收集 SSTRecord,但不需要将其传入。为了提供帮助,此类包含一个 HSSFListener 包装器,它将为您进行收集。)
Modifier and Type | Class and Description |
---|---|
static class |
EventWorkbookBuilder.SheetRecordCollectingListener
A wrapping HSSFListener which will collect
BoundSheetRecord s and
ExternSheetRecord s as they go past, so you can create a Stub
InternalWorkbook from them once required.
(一个包装 HSSFListener 将在 BoundSheetRecords 和 ExternSheetRecords 过去时收集它们,因此您可以在需要时从它们创建一个 Stub InternalWorkbook。)
|
Constructor and Description |
---|
EventWorkbookBuilder() |
Modifier and Type | Method and Description |
---|---|
static InternalWorkbook |
createStubWorkbook(ExternSheetRecord[] externs, BoundSheetRecord[] bounds)
Creates a stub workbook from the supplied records, suitable for use with the
HSSFFormulaParser
(根据提供的记录创建存根工作簿,适用于 HSSFFormulaParser)
|
static InternalWorkbook |
createStubWorkbook(ExternSheetRecord[] externs, BoundSheetRecord[] bounds, SSTRecord sst)
Creates a stub Workbook from the supplied records, suitable for use with the
HSSFFormulaParser
(根据提供的记录创建存根工作簿,适用于 HSSFFormulaParser)
|
public static InternalWorkbook createStubWorkbook(ExternSheetRecord[] externs, BoundSheetRecord[] bounds, SSTRecord sst)
HSSFFormulaParser
(根据提供的记录创建存根工作簿,适用于 HSSFFormulaParser)
externs
- The ExternSheetRecords in your file
(externs - 文件中的 ExternSheetRecords)
bounds
- The BoundSheetRecords in your file
(bounds - 文件中的 BoundSheetRecords)
sst
- The SSTRecord in your file.
(sst - 文件中的 SSTRecord。)
HSSFFormulaParser
(适用于 HSSFFormulaParser 的存根工作簿)
public static InternalWorkbook createStubWorkbook(ExternSheetRecord[] externs, BoundSheetRecord[] bounds)
HSSFFormulaParser
(根据提供的记录创建存根工作簿,适用于 HSSFFormulaParser)
externs
- The ExternSheetRecords in your file
(externs - 文件中的 ExternSheetRecords)
bounds
- The BoundSheetRecords in your file
(bounds - 文件中的 BoundSheetRecords)
HSSFFormulaParser
(适用于 HSSFFormulaParser 的存根工作簿)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.