Package org.apache.poi.xssf.extractor
Class XSSFExcelExtractor
java.lang.Object
org.apache.poi.extractor.POITextExtractor
org.apache.poi.ooxml.extractor.POIXMLTextExtractor
org.apache.poi.xssf.extractor.XSSFExcelExtractor
- All Implemented Interfaces:
Closeable,AutoCloseable,ExcelExtractor
Helper class to extract text from an OOXML Excel file
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionXSSFExcelExtractor(OPCPackage container) XSSFExcelExtractor(XSSFWorkbook workbook) -
Method Summary
Modifier and TypeMethodDescriptiongetText()Retrieves the text contents of the filestatic voidvoidsetFormulasNotResults(boolean formulasNotResults) Should we return the formula itself, and not the result it produces? Default is falsevoidsetIncludeCellComments(boolean includeCellComments) Should cell comments be included? Default is falsevoidsetIncludeHeadersFooters(boolean includeHeadersFooters) Should headers and footers be included? Default is truevoidsetIncludeSheetNames(boolean includeSheetNames) Should sheet names be included? Default is truevoidsetIncludeTextBoxes(boolean includeTextBoxes) Should text within textboxes be included? Default is truevoidWhat Locale should be used for formatting numbers (based on the styles applied to the cells)Methods inherited from class org.apache.poi.ooxml.extractor.POIXMLTextExtractor
checkMaxTextSize, close, getCoreProperties, getCustomProperties, getDocument, getExtendedProperties, getMetadataTextExtractor, getPackageMethods inherited from class org.apache.poi.extractor.POITextExtractor
setFilesystem
-
Field Details
-
SUPPORTED_TYPES
-
-
Constructor Details
-
XSSFExcelExtractor
public XSSFExcelExtractor(OPCPackage container) throws org.apache.xmlbeans.XmlException, OpenXML4JException, IOException - Throws:
org.apache.xmlbeans.XmlExceptionOpenXML4JExceptionIOException
-
XSSFExcelExtractor
-
-
Method Details
-
main
- Throws:
Exception
-
setIncludeSheetNames
public void setIncludeSheetNames(boolean includeSheetNames) Should sheet names be included? Default is true- Specified by:
setIncludeSheetNamesin interfaceExcelExtractor- Parameters:
includeSheetNames-trueif the sheet names should be included
-
setFormulasNotResults
public void setFormulasNotResults(boolean formulasNotResults) Should we return the formula itself, and not the result it produces? Default is false- Specified by:
setFormulasNotResultsin interfaceExcelExtractor- Parameters:
formulasNotResults-trueif the formula itself is returned
-
setIncludeCellComments
public void setIncludeCellComments(boolean includeCellComments) Should cell comments be included? Default is false- Specified by:
setIncludeCellCommentsin interfaceExcelExtractor- Parameters:
includeCellComments-trueif cell comments should be included
-
setIncludeTextBoxes
public void setIncludeTextBoxes(boolean includeTextBoxes) Should text within textboxes be included? Default is true- Parameters:
includeTextBoxes- True if textboxes should be included, false if not.
-
setLocale
What Locale should be used for formatting numbers (based on the styles applied to the cells) -
getText
Retrieves the text contents of the file- Specified by:
getTextin interfaceExcelExtractor- Specified by:
getTextin classPOITextExtractor- Returns:
- All the text from the document
-