public interface Parser
Modifier and Type | Method and Description |
---|---|
String |
getAuthor() |
String |
getContent() |
String |
getEncoding()
The character encoding of the content to be parsed
|
String |
getFilename()
The original file name of the content to be parsed
|
Locale |
getLocale()
The locale of the content to be parsed
|
String |
getSourceDate() |
String |
getTags() |
String |
getTitle() |
String |
getVersion() |
void |
parse(File file)
Same as the other method that accept an input stream, use this when you
have a file rather than a stream.
|
void |
parse(InputStream input)
Extracts content for the text content of the given binary document.
|
void |
setEncoding(String encoding) |
void |
setFilename(String filename) |
void |
setLocale(Locale locale) |
String getVersion()
String getContent()
String getAuthor()
String getSourceDate()
String getTags()
String getTitle()
String getFilename()
void setFilename(String filename)
Locale getLocale()
void setLocale(Locale locale)
String getEncoding()
void setEncoding(String encoding)
void parse(File file)
file
- void parse(InputStream input)
#getContentTypes()
unless the implementation
explicitly permits other content types.
The implementation can choose either to read and parse the given document immediately or to return a reader that does it incrementally. The only constraint is that the implementation must close the given stream latest when the returned reader is closed. The caller on the other hand is responsible for closing the returned reader.
The implementation should only throw an exception on transient errors, i.e. when it can expect to be able to successfully extract the text content of the same binary at another time. An effort should be made to recover from syntax errors and other similar problems.
This method should be thread-safe, i.e. it is possible that this method is invoked simultaneously by different threads to extract the text content of different documents. On the other hand the returned reader does not need to be thread-safe.
The parsing has to be completed before the seconds specified in the parser.timeout config. property.
input
- binary document from which to extract textCopyright © 2008-2014 Logical Objects. All Rights Reserved.