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:
    java.io.Closeable, java.lang.AutoCloseable, ExcelExtractor

      public class XSSFExcelExtractor
      extends POIXMLTextExtractor
      implements ExcelExtractor

  Helper class to extract text from an OOXML Excel file

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static XSSFRelation[]` | `SUPPORTED_TYPES`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `XSSFExcelExtractor(OPCPackage container)`
    `XSSFExcelExtractor(XSSFWorkbook workbook)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getText()` Retrieves the text contents of the file
    `static void` | `main(java.lang.String[] args)`
    `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 within textboxes be included? Default is true
    `void` | `setLocale(java.util.Locale locale)` What 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, getPackage`

    - ### Methods inherited from class org.apache.poi.extractor.POITextExtractor

      `setFilesystem`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### SUPPORTED_TYPES

          public static final XSSFRelation[] SUPPORTED_TYPES

  - ### Constructor Detail

    - #### XSSFExcelExtractor

          public XSSFExcelExtractor(OPCPackage container)
                             throws org.apache.xmlbeans.XmlException,
                                    OpenXML4JException,
                                    java.io.IOException

      Throws:
        `org.apache.xmlbeans.XmlException`
        `OpenXML4JException`
        `java.io.IOException`

    - #### XSSFExcelExtractor

          public XSSFExcelExtractor(XSSFWorkbook workbook)

  - ### Method Detail

    - #### main

          public static void main(java.lang.String[] args)
                           throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### setIncludeSheetNames

          public void setIncludeSheetNames(boolean includeSheetNames)

      Should sheet names be included? Default is true
      Specified by:
        `setIncludeSheetNames` in interface `ExcelExtractor`
      Parameters:
        `includeSheetNames` - `true` if 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:
        `setFormulasNotResults` in interface `ExcelExtractor`
      Parameters:
        `formulasNotResults` - `true` if the formula itself is returned

    - #### setIncludeCellComments

          public void setIncludeCellComments(boolean includeCellComments)

      Should cell comments be included? Default is false
      Specified by:
        `setIncludeCellComments` in interface `ExcelExtractor`
      Parameters:
        `includeCellComments` - `true` if cell comments should be included

    - #### setIncludeHeadersFooters

          public void setIncludeHeadersFooters(boolean includeHeadersFooters)

      Should headers and footers be included? Default is true
      Specified by:
        `setIncludeHeadersFooters` in interface `ExcelExtractor`
      Parameters:
        `includeHeadersFooters` - `true` if headers and footers 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

          public void setLocale(java.util.Locale locale)

      What Locale should be used for formatting numbers (based on the styles applied to the cells)

    - #### getText

          public java.lang.String getText()

      Retrieves the text contents of the file
      Specified by:
        `getText` in interface `ExcelExtractor`
      Specified by:
        `getText` in class `POITextExtractor`
      Returns:
        All the text from the document

Copyright 2020 The Apache Software Foundation or its licensors, as applicable.