Package net.sf.okapi.common.filterwriter
Interface IFilterWriter
-
- All Superinterfaces:
AutoCloseable
- All Known Subinterfaces:
IPackageWriter
- All Known Implementing Classes:
BasePackageWriter
,CorpusFilterWriter
,DoxygenWriter
,GenericFilterWriter
,ICMLFilterWriter
,IDMLFilterWriter
,MarkdownFilterWriter
,MosesTextFilterWriter
,OmegaTPackageWriter
,OntramPackageWriter
,OpenXMLFilterWriter
,PensieveFilterWriter
,POPackageWriter
,POWriter
,ProtoBufferWriter
,SkeletonMergerWriter
,TableFilterWriter
,TablePackageWriter
,TMXFilterWriter
,TransifexFilterWriter
,TransifexPackageWriter
,TransTableWriter
,WikiWriter
,WordTableFilterWriter
,XINIRainbowkitWriter
,XINIWriter
,XLIFF2FilterWriter
,XLIFF2PackageWriter
,XLIFF2TerminologyPackageWriter
,XLIFFPackageWriter
,XLIFFWriter
,ZipFilterWriter
public interface IFilterWriter extends AutoCloseable
Provides the common methods to generate an output from the events generated by a class that implements IFilter.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
cancel()
Cancels the current process.void
close()
Closes the output.EncoderManager
getEncoderManager()
Gets the current encoder manager for this writer.String
getName()
Gets the name of this writer.IParameters
getParameters()
Gets the current parameters for this writer.ISkeletonWriter
getSkeletonWriter()
Gets the skeleton writer associated with this writer.Event
handleEvent(Event event)
Handles the filter events.void
setOptions(LocaleId locale, String defaultEncoding)
Sets the options for this writer.void
setOutput(OutputStream output)
Sets the output through its output stream.void
setOutput(String path)
Sets the output through the path of the output file.void
setParameters(IParameters params)
Sets new parameters for this writer.
-
-
-
Method Detail
-
getName
String getName()
Gets the name of this writer.- Returns:
- The name of the writer.
-
setOptions
void setOptions(LocaleId locale, String defaultEncoding)
Sets the options for this writer.- Parameters:
locale
- the output locale.defaultEncoding
- Name of the character set encoding for the output.
-
setOutput
void setOutput(String path)
Sets the output through the path of the output file.- Parameters:
path
- Full path of the output file.
-
setOutput
void setOutput(OutputStream output)
Sets the output through its output stream.- Parameters:
output
- Output stream to use for the output.
-
handleEvent
Event handleEvent(Event event)
Handles the filter events.- Parameters:
event
- The event to process.- Returns:
- The event that was processed.
-
close
void close()
Closes the output. Developers must make sure this method is safe to call even if there is nothing to close.- Specified by:
close
in interfaceAutoCloseable
-
getParameters
IParameters getParameters()
Gets the current parameters for this writer.- Returns:
- The current parameters for this writer.
-
setParameters
void setParameters(IParameters params)
Sets new parameters for this writer.- Parameters:
params
- The new parameters to use.
-
cancel
void cancel()
Cancels the current process.
-
getEncoderManager
EncoderManager getEncoderManager()
Gets the current encoder manager for this writer. Some special implementation of IFilterWriter may not use an encoder manager (for example writers that do not use skeleton).- Returns:
- the current encoder manager for this writer, or null if none exists for this writer.
-
getSkeletonWriter
ISkeletonWriter getSkeletonWriter()
Gets the skeleton writer associated with this writer. Some implementation of IFilterWriter may not use a skeleton writer.- Returns:
- the skeleton writer associated with this writer or null if none is associated.
-
-