Top Description Methods
org.apache.poi.extractor

public Interface POITextExtractor

extends Closeable
Known Direct Subinterfaces
org.apache.poi.extractor.POIOLE2TextExtractor
Known Direct Implementers
org.apache.poi.hssf.extractor.OldExcelExtractor, org.apache.poi.sl.extractor.SlideShowExtractor
Imports
java.io.Closeable, .IOException

Common Parent for Text Extractors of POI Documents. You will typically find the implementation of a given format's text extractor under org.apache.poi.[format].extractor .
See Also
org.apache.poi.hssf.extractor.ExcelExtractor, org.apache.poi.hdgf.extractor.VisioTextExtractor, org.apache.poi.hwpf.extractor.WordExtractor

Method Summary

Modifier and TypeMethod and Description
public default void
close()

Implements java.io.Closeable.close.

Allows to free resources of the Extractor as soon as it is not needed any more.

public Object

Returns:

the processed document
getDocument
()

public Closeable

Returns:

The underlying resources/filesystem
getFilesystem
()

public POITextExtractor

Returns:

the metadata and text extractor
getMetadataTextExtractor
()

Returns another text extractor, which is able to output the textual content of the document metadata / properties, such as author and title.

public String

Returns:

All the text from the document
getText
()

Retrieves all the text from the document.

public boolean

Returns:

true, if resources/filesystem should be closed on close()
isCloseFilesystem
()

public void
setCloseFilesystem(boolean
true (default), if underlying resources/filesystem should be closed on close()
doCloseFilesystem
)

Method Detail

closeback to summary
public default void close() throws IOException

Implements java.io.Closeable.close.

Allows to free resources of the Extractor as soon as it is not needed any more. This may include closing open file handles and freeing memory. The Extractor cannot be used after close has been called.

Annotations
@Override
Exceptions
IOException:

Doc from java.io.Closeable.close.

if an I/O error occurs

getDocumentback to summary
public Object getDocument()
Returns:Object

the processed document

getFilesystemback to summary
public Closeable getFilesystem()
Returns:Closeable

The underlying resources/filesystem

getMetadataTextExtractorback to summary
public POITextExtractor getMetadataTextExtractor()

Returns another text extractor, which is able to output the textual content of the document metadata / properties, such as author and title.

Returns:POITextExtractor

the metadata and text extractor

getTextback to summary
public String getText()

Retrieves all the text from the document. How cells, paragraphs etc are separated in the text is implementation specific - see the javadocs for a specific project for details.

Returns:String

All the text from the document

isCloseFilesystemback to summary
public boolean isCloseFilesystem()
Returns:boolean

true, if resources/filesystem should be closed on close()

setCloseFilesystemback to summary
public void setCloseFilesystem(boolean doCloseFilesystem)
Parameters
doCloseFilesystem:boolean

true (default), if underlying resources/filesystem should be closed on close()