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.
|
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, waitcheckMaxTextSize, close, getMetadataTextExtractorprotected 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.XmlExceptionOpenXML4JExceptionjava.io.IOExceptionpublic XSSFEventBasedExcelExtractor(OPCPackage container) throws org.apache.xmlbeans.XmlException, OpenXML4JException, java.io.IOException
org.apache.xmlbeans.XmlExceptionOpenXML4JExceptionjava.io.IOExceptionpublic void setIncludeSheetNames(boolean includeSheetNames)
setIncludeSheetNames in interface ExcelExtractorincludeSheetNames - true if the sheet names should be includedpublic boolean getIncludeSheetNames()
public void setFormulasNotResults(boolean formulasNotResults)
setFormulasNotResults in interface ExcelExtractorformulasNotResults - true if the formula itself is returnedpublic boolean getFormulasNotResults()
public void setIncludeHeadersFooters(boolean includeHeadersFooters)
setIncludeHeadersFooters in interface ExcelExtractorincludeHeadersFooters - true if headers and footers should be includedpublic boolean getIncludeHeadersFooters()
public void setIncludeTextBoxes(boolean includeTextBoxes)
public boolean getIncludeTextBoxes()
public void setIncludeCellComments(boolean includeCellComments)
setIncludeCellComments in interface ExcelExtractorincludeCellComments - true if cell comments should be includedpublic boolean getIncludeCellComments()
public void setConcatenatePhoneticRuns(boolean concatenatePhoneticRuns)
concatenatePhoneticRuns - true if runs should be concatenated, false otherwisepublic void setLocale(java.util.Locale locale)
public java.util.Locale getLocale()
public OPCPackage getPackage()
getPackage in interface POIXMLTextExtractorpublic POIXMLProperties.CoreProperties getCoreProperties()
getCoreProperties in interface POIXMLTextExtractorpublic POIXMLProperties.ExtendedProperties getExtendedProperties()
getExtendedProperties in interface POIXMLTextExtractorpublic POIXMLProperties.CustomProperties getCustomProperties()
getCustomProperties in interface POIXMLTextExtractorpublic 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.IOExceptionorg.xml.sax.SAXExceptionprotected SharedStrings createSharedStringsTable(XSSFReader xssfReader, OPCPackage container) throws java.io.IOException, org.xml.sax.SAXException
java.io.IOExceptionorg.xml.sax.SAXExceptionpublic java.lang.String getText()
getText in interface POITextExtractorgetText in interface ExcelExtractorpublic POIXMLDocument getDocument()
POIXMLTextExtractorgetDocument in interface POITextExtractorgetDocument in interface POIXMLTextExtractorpublic void setCloseFilesystem(boolean doCloseFilesystem)
setCloseFilesystem in interface POITextExtractordoCloseFilesystem - true (default), if underlying resources/filesystem should be
closed on POITextExtractor.close()public boolean isCloseFilesystem()
isCloseFilesystem in interface POITextExtractortrue, if resources/filesystem should be closed on POITextExtractor.close()public OPCPackage getFilesystem()
getFilesystem in interface POITextExtractorCopyright 2021 The Apache Software Foundation or its licensors, as applicable.