public class EventBasedExcelExtractor extends java.lang.Object implements POIOLE2TextExtractor, ExcelExtractor
ExcelExtractor
, but may not provide
the same richness of formatting.
Returns the textual content of the file, suitable for
indexing by something like Lucene, but not really
intended for display to the user.
To turn an excel file into a CSV or similar, then see the XLS2CSVmra example
Constructor and Description |
---|
EventBasedExcelExtractor(DirectoryNode dir) |
EventBasedExcelExtractor(POIFSFileSystem fs) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Allows to free resources of the Extractor as soon as
it is not needed any more.
|
DocumentSummaryInformation |
getDocSummaryInformation()
Would return the document information metadata for the document,
if we supported it
|
POIDocument |
getDocument()
Return the underlying POIDocument
|
java.io.Closeable |
getFilesystem() |
DirectoryEntry |
getRoot()
Return the underlying DirectoryEntry of this document.
|
SummaryInformation |
getSummaryInformation()
Would return the summary information metadata for the document,
if we supported it
|
java.lang.String |
getText()
Retreives the text contents of the file
|
boolean |
isCloseFilesystem() |
void |
setCloseFilesystem(boolean doCloseFilesystem) |
void |
setFormulasNotResults(boolean formulasNotResults)
Should we return the formula itself, and not
the result it produces? Default is false
|
void |
setIncludeCellComments(boolean includeComments)
Would control the inclusion of cell comments from the document,
if we supported it
|
void |
setIncludeHeadersFooters(boolean includeHeadersFooters)
Would control the inclusion of headers and footers from the document,
if we supported it
|
void |
setIncludeSheetNames(boolean includeSheetNames)
Should sheet names be included? Default is true
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMetadataTextExtractor
public EventBasedExcelExtractor(DirectoryNode dir)
public EventBasedExcelExtractor(POIFSFileSystem fs)
public DocumentSummaryInformation getDocSummaryInformation()
getDocSummaryInformation
in interface POIOLE2TextExtractor
public SummaryInformation getSummaryInformation()
getSummaryInformation
in interface POIOLE2TextExtractor
public void setIncludeCellComments(boolean includeComments)
setIncludeCellComments
in interface ExcelExtractor
includeComments
- true
if cell comments should be includedpublic void setIncludeHeadersFooters(boolean includeHeadersFooters)
setIncludeHeadersFooters
in interface ExcelExtractor
includeHeadersFooters
- true
if headers and footers should be includedpublic void setIncludeSheetNames(boolean includeSheetNames)
setIncludeSheetNames
in interface ExcelExtractor
includeSheetNames
- true
if the sheet names should be includedpublic void setFormulasNotResults(boolean formulasNotResults)
setFormulasNotResults
in interface ExcelExtractor
formulasNotResults
- true
if the formula itself is returnedpublic java.lang.String getText()
getText
in interface POITextExtractor
getText
in interface ExcelExtractor
public void setCloseFilesystem(boolean doCloseFilesystem)
setCloseFilesystem
in interface POITextExtractor
doCloseFilesystem
- true
(default), if underlying resources/filesystem should be
closed on POITextExtractor.close()
public boolean isCloseFilesystem()
isCloseFilesystem
in interface POITextExtractor
true
, if resources/filesystem should be closed on POITextExtractor.close()
public java.io.Closeable getFilesystem()
getFilesystem
in interface POITextExtractor
public POIDocument getDocument()
POIOLE2TextExtractor
getDocument
in interface POIOLE2TextExtractor
getDocument
in interface POITextExtractor
public DirectoryEntry getRoot()
POIOLE2TextExtractor
getRoot
in interface POIOLE2TextExtractor
public void close() throws java.io.IOException
POITextExtractor
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in interface POITextExtractor
java.io.IOException
Copyright 2022 The Apache Software Foundation or its licensors, as applicable.