public final class XmlTextExtractor extends TextExtractor
Provides the text reader for XML documents.
Reading a text from XML file:
// Create a text extractor for XML documents
XmlTextExtractor extractor = new XmlTextExtractor(stream);
// Extract a text
System.out.println(extractor.extractAll());
Constructor and Description |
---|
XmlTextExtractor(InputStream stream)
Initializes a new instance of the
XmlTextExtractor class. |
XmlTextExtractor(InputStream stream,
LoadOptions loadOptions)
Initializes a new instance of the
XmlTextExtractor class. |
XmlTextExtractor(String fileName)
Initializes a new instance of the
XmlTextExtractor class. |
XmlTextExtractor(String fileName,
LoadOptions loadOptions)
Initializes a new instance of the
XmlTextExtractor class. |
Modifier and Type | Method and Description |
---|---|
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
public XmlTextExtractor(String fileName)
Initializes a new instance of the XmlTextExtractor
class.
fileName
- The path to the file.public XmlTextExtractor(String fileName, LoadOptions loadOptions)
Initializes a new instance of the XmlTextExtractor
class.
fileName
- The path to the file.loadOptions
- The options of loading the file.public XmlTextExtractor(InputStream stream)
Initializes a new instance of the XmlTextExtractor
class.
stream
- The stream of the document.public XmlTextExtractor(InputStream stream, LoadOptions loadOptions)
Initializes a new instance of the XmlTextExtractor
class.
stream
- The stream of the document.loadOptions
- The options of loading the file.public void reset()
Resets the current document.
ExtractLine
method will return the first line of the document.
reset
in class TextExtractor
protected String prepareLine()
Returns a line of the text.
prepareLine
in class TextExtractor
Copyright © 2019. All rights reserved.