public interface ConvertPlugin extends Plugin
Modifier and Type | Method and Description |
---|---|
boolean |
canConvert(PushbackInputStream is,
Charset cs,
String inputFormat)
Can this converter convert this file
|
Set<String> |
getInputFormats()
Get a list of file extensions or formats (not strictly formatIdentifiers,
though there might be overlap) that this converter can convert from.
|
String |
getOutputFormat()
Get the name of the format this plugin will convert files into.
|
void |
perform(InputStream is,
Charset cs,
String inputFormat,
OutputStream os)
Perform on a text file.
|
configStr, getDescription, getDisplayName, getId, init, needsConfig
Set<String> getInputFormats()
perform(InputStream, Charset, String, OutputStream)
, so
exact spelling, punctuation or capitalization is not of technical importance.
This overlaps somewhat with the purpose of getDescription() but it's
important we have a consistent way of describing converter capabilties.String getOutputFormat()
getInputFormats()
, this format must match a format
accepted by a TagPlugin
. Should be as descriptive as possible (e.g.
just "xml" is not exact enough, because xml can mean different things based
on the contents of the file, so instead use "folia" or "tei", or whatever
contents the file happens to have).boolean canConvert(PushbackInputStream is, Charset cs, String inputFormat)
is
- stream containing a pushback buffer of at least 251 characterscs
- (optional) charset of the inputstream, if this is a text
(non-binary) file typeinputFormat
- void perform(InputStream is, Charset cs, String inputFormat, OutputStream os) throws PluginException
is
- input. Should not be closed by the implementation.cs
- as inputFormat, but for the charset of the inputStream, not always
meaningful, but required for some implementations that transform
textual data.inputFormat
- arbitrary string describing input data, can be file
extension, or more semantic. Usage may vary, so acceptable values
must be coordinated between callers and implementations.os
- output. Should not be closed by the implementation.PluginException
Copyright © 2020 Instituut voor Nederlandse Taal (INT). All rights reserved.