public abstract class EpubTextExtractorBase extends TextExtractor
Provides the base class of text extractors for EPUB documents.
Modifier | Constructor and Description |
---|---|
protected |
EpubTextExtractorBase(InputStream stream)
Initializes a new instance of the
EpubTextExtractorBase class. |
Modifier and Type | Method and Description |
---|---|
protected abstract String |
extractItem(String path)
Extracts a text from the document's item.
|
EpubPackage |
get_Item(int index)
Gets a package.
|
int |
getCount()
Gets a total number of packages.
|
protected InputStream |
openContainerItem(String path)
Creates a stream with the content of the document's item.
|
protected String |
prepareLine()
Returns a line of the text.
|
void |
reset()
Resets the current document.
|
checkDisposed, close, dispose, dispose, extractAll, extractLine, extractText, extractTextLine, getEncoding, getMediaType, getPassword, isDisposed, setEncoding, setMediaType
protected EpubTextExtractorBase(InputStream stream)
Initializes a new instance of the EpubTextExtractorBase
class.
stream
- The stream of the document.public int getCount()
Gets a total number of packages.
public EpubPackage get_Item(int index)
Gets a package.
index
- An index of the package.EpubPackage
class.public void reset()
Resets the current document.
ExtractLine
method will return the first line of the document.
reset
in class TextExtractor
protected InputStream openContainerItem(String path)
Creates a stream with the content of the document's item.
path
- A path to the document's item.java.io.InputStream
with the content of the document's item or null if entity is not found.protected abstract String extractItem(String path)
Extracts a text from the document's item.
path
- A path to the document's item.protected String prepareLine()
Returns a line of the text.
prepareLine
in class TextExtractor
Copyright © 2019. All rights reserved.