Package org.apache.poi.xssf.extractor
Class XSSFExcelExtractor
- java.lang.Object
-
- org.apache.poi.xssf.extractor.XSSFExcelExtractor
-
- All Implemented Interfaces:
Closeable,AutoCloseable,POITextExtractor,POIXMLTextExtractor,ExcelExtractor
public class XSSFExcelExtractor extends Object implements POIXMLTextExtractor, ExcelExtractor
Helper class to extract text from an OOXML Excel file
-
-
Field Summary
Fields Modifier and Type Field Description static List<XSSFRelation>SUPPORTED_TYPES
-
Constructor Summary
Constructors Constructor Description XSSFExcelExtractor(OPCPackage container)XSSFExcelExtractor(XSSFWorkbook workbook)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XSSFWorkbookgetDocument()Returns opened documentXSSFWorkbookgetFilesystem()StringgetText()Retrieves the text contents of the filebooleanisCloseFilesystem()voidsetCloseFilesystem(boolean doCloseFilesystem)voidsetFormulasNotResults(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 truevoidsetLocale(Locale locale)What Locale should be used for formatting numbers (based on the styles applied to the cells)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.poi.ooxml.extractor.POIXMLTextExtractor
checkMaxTextSize, close, getCoreProperties, getCustomProperties, getExtendedProperties, getMetadataTextExtractor, getPackage
-
-
-
-
Field Detail
-
SUPPORTED_TYPES
public static final List<XSSFRelation> SUPPORTED_TYPES
-
-
Constructor Detail
-
XSSFExcelExtractor
public XSSFExcelExtractor(OPCPackage container) throws XmlException, OpenXML4JException, IOException
-
XSSFExcelExtractor
public XSSFExcelExtractor(XSSFWorkbook workbook)
-
-
Method Detail
-
setIncludeSheetNames
public void setIncludeSheetNames(boolean includeSheetNames)
Should sheet names be included? Default is true- Specified by:
setIncludeSheetNamesin interfaceExcelExtractor
-
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
-
setIncludeCellComments
public void setIncludeCellComments(boolean includeCellComments)
Should cell comments be included? Default is false- Specified by:
setIncludeCellCommentsin interfaceExcelExtractor
-
setIncludeHeadersFooters
public void setIncludeHeadersFooters(boolean includeHeadersFooters)
Should headers and footers be included? Default is true- Specified by:
setIncludeHeadersFootersin interfaceExcelExtractor
-
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
public void setLocale(Locale locale)
What Locale should be used for formatting numbers (based on the styles applied to the cells)
-
getText
public String getText()
Retrieves the text contents of the file- Specified by:
getTextin interfaceExcelExtractor- Specified by:
getTextin interfacePOITextExtractor
-
getDocument
public XSSFWorkbook getDocument()
Description copied from interface:POIXMLTextExtractorReturns opened document- Specified by:
getDocumentin interfacePOITextExtractor- Specified by:
getDocumentin interfacePOIXMLTextExtractor- Returns:
- the opened document
-
setCloseFilesystem
public void setCloseFilesystem(boolean doCloseFilesystem)
- Specified by:
setCloseFilesystemin interfacePOITextExtractor
-
isCloseFilesystem
public boolean isCloseFilesystem()
- Specified by:
isCloseFilesystemin interfacePOITextExtractor
-
getFilesystem
public XSSFWorkbook getFilesystem()
- Specified by:
getFilesystemin interfacePOITextExtractor
-
-