public class XSSFEventBasedExcelExtractor extends java.lang.Object implements POIXMLTextExtractor, ExcelExtractor
Modifier and Type | Class and Description |
---|---|
protected class |
XSSFEventBasedExcelExtractor.SheetTextExtractor |
Modifier and Type | Field and Description |
---|---|
protected boolean |
concatenatePhoneticRuns |
protected OPCPackage |
container |
protected boolean |
formulasNotResults |
protected boolean |
includeCellComments |
protected boolean |
includeHeadersFooters |
protected boolean |
includeSheetNames |
protected boolean |
includeTextBoxes |
protected java.util.Locale |
locale |
protected POIXMLProperties |
properties |
Constructor and Description |
---|
XSSFEventBasedExcelExtractor(OPCPackage container) |
XSSFEventBasedExcelExtractor(java.lang.String path) |
Modifier and Type | Method and Description |
---|---|
protected SharedStrings |
createSharedStringsTable(XSSFReader xssfReader, OPCPackage container) |
POIXMLProperties.CoreProperties |
getCoreProperties()
Returns the core document properties
(返回核心文档属性)
|
POIXMLProperties.CustomProperties |
getCustomProperties()
Returns the custom document properties
(返回自定义文档属性)
|
POIXMLDocument |
getDocument()
Returns opened document
(返回打开的文档)
|
POIXMLProperties.ExtendedProperties |
getExtendedProperties()
Returns the extended document properties
(返回扩展文档属性)
|
OPCPackage |
getFilesystem() |
boolean |
getFormulasNotResults() |
boolean |
getIncludeCellComments() |
boolean |
getIncludeHeadersFooters() |
boolean |
getIncludeSheetNames() |
boolean |
getIncludeTextBoxes() |
java.util.Locale |
getLocale() |
OPCPackage |
getPackage()
Returns the opened OPCPackage container.
(返回打开的 OPCPackage 容器。)
|
java.lang.String |
getText()
Processes the file and returns the text
(处理文件并返回文本)
|
boolean |
isCloseFilesystem() |
void |
processSheet(XSSFSheetXMLHandler.SheetContentsHandler sheetContentsExtractor, Styles styles, Comments comments, SharedStrings strings, java.io.InputStream sheetInputStream)
Processes the given sheet
(处理给定的工作表)
|
void |
setCloseFilesystem(boolean doCloseFilesystem) |
void |
setConcatenatePhoneticRuns(boolean concatenatePhoneticRuns)
Concatenate text from <rPh> text elements in SharedStringsTable Default is true;
(连接来自的文本
|
void |
setFormulasNotResults(boolean formulasNotResults)
Should we return the formula itself, and not the result it produces? Default is false
(我们应该返回公式本身,而不是它产生的结果吗?默认为假)
|
void |
setIncludeCellComments(boolean includeCellComments)
Should cell comments be included? Default is false
(应该包括单元格注释吗?默认为假)
|
void |
setIncludeHeadersFooters(boolean includeHeadersFooters)
Should headers and footers be included? Default is true
(是否应该包含页眉和页脚?默认为真)
|
void |
setIncludeSheetNames(boolean includeSheetNames)
Should sheet names be included? Default is true
(应该包括工作表名称吗?默认为真)
|
void |
setIncludeTextBoxes(boolean includeTextBoxes)
Should text from textboxes be included? Default is true
(是否应该包含来自文本框的文本?默认为真)
|
void |
setLocale(java.util.Locale locale) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkMaxTextSize, close, getMetadataTextExtractor
protected final OPCPackage container
protected final POIXMLProperties properties
protected java.util.Locale locale
protected boolean includeTextBoxes
protected boolean includeSheetNames
protected boolean includeCellComments
protected boolean includeHeadersFooters
protected boolean formulasNotResults
protected boolean concatenatePhoneticRuns
public XSSFEventBasedExcelExtractor(java.lang.String path) throws org.apache.xmlbeans.XmlException, OpenXML4JException, java.io.IOException
org.apache.xmlbeans.XmlException
(org.apache.xmlbeans.XmlException)
OpenXML4JException
(OpenXML4JException)
java.io.IOException
(java.io.IOException)
public XSSFEventBasedExcelExtractor(OPCPackage container) throws org.apache.xmlbeans.XmlException, OpenXML4JException, java.io.IOException
org.apache.xmlbeans.XmlException
(org.apache.xmlbeans.XmlException)
OpenXML4JException
(OpenXML4JException)
java.io.IOException
(java.io.IOException)
public void setIncludeSheetNames(boolean includeSheetNames)
setIncludeSheetNames
in interface
ExcelExtractor
(接口 ExcelExtractor 中的 setIncludeSheetNames)
includeSheetNames
-
true
if the sheet names should be included
(includeSheetNames - 如果应包含工作表名称,则为 true)
public boolean getIncludeSheetNames()
public void setFormulasNotResults(boolean formulasNotResults)
setFormulasNotResults
in interface
ExcelExtractor
(接口 ExcelExtractor 中的 setFormulasNotResults)
formulasNotResults
-
true
if the formula itself is returned
(formulasNotResults - 如果返回公式本身,则为 true)
public boolean getFormulasNotResults()
public void setIncludeHeadersFooters(boolean includeHeadersFooters)
setIncludeHeadersFooters
in interface
ExcelExtractor
(接口 ExcelExtractor 中的 setIncludeHeadersFooters)
includeHeadersFooters
-
true
if headers and footers should be included
(includeHeadersFooters - 如果应该包含页眉和页脚,则为 true)
public boolean getIncludeHeadersFooters()
public void setIncludeTextBoxes(boolean includeTextBoxes)
public boolean getIncludeTextBoxes()
public void setIncludeCellComments(boolean includeCellComments)
setIncludeCellComments
in interface
ExcelExtractor
(接口 ExcelExtractor 中的 setIncludeCellComments)
includeCellComments
-
true
if cell comments should be included
(includeCellComments - 如果应该包含单元格注释,则为 true)
public boolean getIncludeCellComments()
public void setConcatenatePhoneticRuns(boolean concatenatePhoneticRuns)
concatenatePhoneticRuns
- true if runs should be concatenated, false otherwise
(concatenatePhoneticRuns - 如果应该连接运行,则为 true,否则为 false)
public void setLocale(java.util.Locale locale)
public java.util.Locale getLocale()
public OPCPackage getPackage()
getPackage
in interface
POIXMLTextExtractor
(接口 POIXMLTextExtractor 中的 getPackage)
public POIXMLProperties.CoreProperties getCoreProperties()
getCoreProperties
in interface
POIXMLTextExtractor
(接口 POIXMLTextExtractor 中的 getCoreProperties)
public POIXMLProperties.ExtendedProperties getExtendedProperties()
getExtendedProperties
in interface
POIXMLTextExtractor
(接口 POIXMLTextExtractor 中的 getExtendedProperties)
public POIXMLProperties.CustomProperties getCustomProperties()
getCustomProperties
in interface
POIXMLTextExtractor
(接口 POIXMLTextExtractor 中的 getCustomProperties)
public void processSheet(XSSFSheetXMLHandler.SheetContentsHandler sheetContentsExtractor, Styles styles, Comments comments, SharedStrings strings, java.io.InputStream sheetInputStream) throws java.io.IOException, org.xml.sax.SAXException
java.io.IOException
(java.io.IOException)
org.xml.sax.SAXException
(org.xml.sax.SAXException)
protected SharedStrings createSharedStringsTable(XSSFReader xssfReader, OPCPackage container) throws java.io.IOException, org.xml.sax.SAXException
java.io.IOException
(java.io.IOException)
org.xml.sax.SAXException
(org.xml.sax.SAXException)
public java.lang.String getText()
getText
in interface
POITextExtractor
(接口 POITextExtractor 中的 getText)
getText
in interface
ExcelExtractor
(接口 ExcelExtractor 中的 getText)
public POIXMLDocument getDocument()
POIXMLTextExtractor
getDocument
in interface
POITextExtractor
(接口 POITextExtractor 中的 getDocument)
getDocument
in interface
POIXMLTextExtractor
(接口 POIXMLTextExtractor 中的 getDocument)
public void setCloseFilesystem(boolean doCloseFilesystem)
setCloseFilesystem
in interface
POITextExtractor
(接口 POITextExtractor 中的 setCloseFilesystem)
doCloseFilesystem
-
true
(default), if underlying resources/filesystem should be closed on
POITextExtractor.close()
(doCloseFilesystem - true(默认),如果底层资源/文件系统应该在 POITextExtractor.close() 上关闭)
public boolean isCloseFilesystem()
isCloseFilesystem
in interface
POITextExtractor
(接口 POITextExtractor 中的 isCloseFilesystem)
true
, if resources/filesystem should be closed on
POITextExtractor.close()
(true,如果资源/文件系统应该在 POITextExtractor.close() 上关闭)
public OPCPackage getFilesystem()
getFilesystem
in interface
POITextExtractor
(接口 POITextExtractor 中的 getFilesystem)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.