Package net.sf.okapi.filters.openxml
Class OpenXMLFilterWriter
- java.lang.Object
-
- net.sf.okapi.filters.openxml.OpenXMLFilterWriter
-
- All Implemented Interfaces:
AutoCloseable,net.sf.okapi.common.filterwriter.IFilterWriter
public class OpenXMLFilterWriter extends Object implements net.sf.okapi.common.filterwriter.IFilterWriter
Implements the IFilterWriter interface for the OpenXMLFilter, which filters Microsoft Office Word, Excel, and Powerpoint Documents. OpenXML is the format of these documents.
Since OpenXML files are Zip files that contain XML documents, this filter writer handles writing out the zip file, and uses OpenXMLContentSkeletonWriter to output the XML documents.
- Version:
- okapi v1.46.0 SV: warning instead of an exception in hangleEvent() SV: added the default clause in handleEvent()
-
-
Constructor Summary
Constructors Constructor Description OpenXMLFilterWriter()No-arg constructor in case it's needed.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()Cancels processing of a filter; yet to be implemented.voidclose()Closes the zip file.net.sf.okapi.common.encoder.EncoderManagergetEncoderManager()StringgetName()Gets the name of the filter writer.net.sf.okapi.filters.openxml.ConditionalParametersgetParameters()net.sf.okapi.common.skeleton.ISkeletonWritergetSkeletonWriter()net.sf.okapi.common.EventhandleEvent(net.sf.okapi.common.Event event)Handles an event.voidsetOptions(net.sf.okapi.common.LocaleId language, String defaultEncoding)voidsetOutput(OutputStream output)voidsetOutput(String path)voidsetParameters(net.sf.okapi.common.IParameters params)
-
-
-
Constructor Detail
-
OpenXMLFilterWriter
public OpenXMLFilterWriter()
No-arg constructor in case it's needed. Create local factory instances. Be aware - it is strongly encouraged to construct the filter writer with the primary constructor (another one) when an Excel document is going to be filtered, otherwise, there is no chance that the dispersed translations will be correctly initialised. Also, the XML input, output and event factories instantiation will not take into account the relevant class loader.
-
-
Method Detail
-
cancel
public void cancel()
Cancels processing of a filter; yet to be implemented.- Specified by:
cancelin interfacenet.sf.okapi.common.filterwriter.IFilterWriter
-
close
public void close()
Closes the zip file.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfacenet.sf.okapi.common.filterwriter.IFilterWriter
-
getName
public String getName()
Gets the name of the filter writer.- Specified by:
getNamein interfacenet.sf.okapi.common.filterwriter.IFilterWriter
-
getEncoderManager
public net.sf.okapi.common.encoder.EncoderManager getEncoderManager()
- Specified by:
getEncoderManagerin interfacenet.sf.okapi.common.filterwriter.IFilterWriter
-
getSkeletonWriter
public net.sf.okapi.common.skeleton.ISkeletonWriter getSkeletonWriter()
- Specified by:
getSkeletonWriterin interfacenet.sf.okapi.common.filterwriter.IFilterWriter
-
handleEvent
public net.sf.okapi.common.Event handleEvent(net.sf.okapi.common.Event event)
Handles an event. Passes all but START_DOCUMENT, END_DOCUMENT, and DOCUMENT_PART to subdocument processing.- Specified by:
handleEventin interfacenet.sf.okapi.common.filterwriter.IFilterWriter- Parameters:
event- the event to process
-
setOptions
public void setOptions(net.sf.okapi.common.LocaleId language, String defaultEncoding)- Specified by:
setOptionsin interfacenet.sf.okapi.common.filterwriter.IFilterWriter
-
setOutput
public void setOutput(String path)
- Specified by:
setOutputin interfacenet.sf.okapi.common.filterwriter.IFilterWriter
-
setOutput
public void setOutput(OutputStream output)
- Specified by:
setOutputin interfacenet.sf.okapi.common.filterwriter.IFilterWriter
-
setParameters
public void setParameters(net.sf.okapi.common.IParameters params)
- Specified by:
setParametersin interfacenet.sf.okapi.common.filterwriter.IFilterWriter
-
getParameters
public net.sf.okapi.filters.openxml.ConditionalParameters getParameters()
- Specified by:
getParametersin interfacenet.sf.okapi.common.filterwriter.IFilterWriter
-
-