Class OpenXMLFilterWriter

  • All Implemented Interfaces:
    AutoCloseable, IFilterWriter

    public class OpenXMLFilterWriter
    extends Object
    implements 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.

    • 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:
        cancel in interface IFilterWriter
      • getName

        public String getName()
        Gets the name of the filter writer.
        Specified by:
        getName in interface IFilterWriter
        Returns:
        The name of the writer.
      • getEncoderManager

        public EncoderManager getEncoderManager()
        Description copied from interface: IFilterWriter
        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).
        Specified by:
        getEncoderManager in interface IFilterWriter
        Returns:
        the current encoder manager for this writer, or null if none exists for this writer.
      • getSkeletonWriter

        public ISkeletonWriter getSkeletonWriter()
        Description copied from interface: IFilterWriter
        Gets the skeleton writer associated with this writer. Some implementation of IFilterWriter may not use a skeleton writer.
        Specified by:
        getSkeletonWriter in interface IFilterWriter
        Returns:
        the skeleton writer associated with this writer or null if none is associated.
      • handleEvent

        public Event handleEvent​(Event event)
        Handles an event. Passes all but START_DOCUMENT, END_DOCUMENT, and DOCUMENT_PART to subdocument processing.
        Specified by:
        handleEvent in interface IFilterWriter
        Parameters:
        event - the event to process
        Returns:
        The event that was processed.
      • setOptions

        public void setOptions​(LocaleId language,
                               String defaultEncoding)
        Description copied from interface: IFilterWriter
        Sets the options for this writer.
        Specified by:
        setOptions in interface IFilterWriter
        Parameters:
        language - the output locale.
        defaultEncoding - Name of the character set encoding for the output.
      • setOutput

        public void setOutput​(String path)
        Description copied from interface: IFilterWriter
        Sets the output through the path of the output file.
        Specified by:
        setOutput in interface IFilterWriter
        Parameters:
        path - Full path of the output file.
      • setOutput

        public void setOutput​(OutputStream output)
        Description copied from interface: IFilterWriter
        Sets the output through its output stream.
        Specified by:
        setOutput in interface IFilterWriter
        Parameters:
        output - Output stream to use for the output.
      • setParameters

        public void setParameters​(IParameters params)
        Description copied from interface: IFilterWriter
        Sets new parameters for this writer.
        Specified by:
        setParameters in interface IFilterWriter
        Parameters:
        params - The new parameters to use.