writer2latex.api
Interface Converter

All Known Implementing Classes:
Converter, Converter, ConverterBase, ConverterPalette, EPUBConverter, Xhtml10Converter, Xhtml11Converter, XhtmlMathMLConverter, XhtmlMathMLXSLConverter

public interface Converter

This is an interface for a converter, which offers conversion of OpenDocument (or OpenOffice.org 1.x) documents into a specific format. Instances of this interface are created using the ConverterFactory


Method Summary
 ConverterResult convert(java.io.File source, java.lang.String sTargetFileName)
          Convert a document
 ConverterResult convert(java.io.InputStream is, java.lang.String sTargetFileName)
          Convert a document
 Config getConfig()
          Get the interface for the configuration of this converter
 void readStyleSheet(java.io.File file)
          Read a style sheet to include with the converted document.
 void readStyleSheet(java.io.InputStream is)
          Read a style sheet to include with the converted document.
 void readTemplate(java.io.File file)
          Read a template to use as a base for the converted document.
 void readTemplate(java.io.InputStream is)
          Read a template to use as a base for the converted document.
 void setGraphicConverter(GraphicConverter gc)
          Define a GraphicConverter implementation to use for conversion of graphic files.
 

Method Detail

getConfig

Config getConfig()
Get the interface for the configuration of this converter

Returns:
the configuration

setGraphicConverter

void setGraphicConverter(GraphicConverter gc)
Define a GraphicConverter implementation to use for conversion of graphic files. If no converter is specified, graphic files will not be converted into other formats.

Parameters:
gc - the GraphicConverter to use

readTemplate

void readTemplate(java.io.InputStream is)
                  throws java.io.IOException
Read a template to use as a base for the converted document. The format of the template depends on the Converter implementation.

Parameters:
is - an InputStream from which to read the template
Throws:
java.io.IOException - if some exception occurs while reading the template

readTemplate

void readTemplate(java.io.File file)
                  throws java.io.IOException
Read a template to use as a base for the converted document. The format of the template depends on the Converter implementation.

Parameters:
file - a file from which to read the template
Throws:
java.io.IOException - if the file does not exist or some exception occurs while reading the template

readStyleSheet

void readStyleSheet(java.io.InputStream is)
                    throws java.io.IOException
Read a style sheet to include with the converted document. The format of the style sheet depends on the Converter implementation.

Parameters:
is - an InputStream from which to read the style sheet
Throws:
java.io.IOException - if some exception occurs while reading the style sheet

readStyleSheet

void readStyleSheet(java.io.File file)
                    throws java.io.IOException
Read a style sheet to include with the converted document. The format of the style sheet depends on the Converter implementation.

Parameters:
file - a file from which to read the style sheet
Throws:
java.io.IOException - if the file does not exist or some exception occurs while reading the style sheet

convert

ConverterResult convert(java.io.InputStream is,
                        java.lang.String sTargetFileName)
                        throws java.io.IOException
Convert a document

Parameters:
is - an InputStream from which to read the source document.
sTargetFileName - the file name to use for the converted document (if the converted document is a compound document consisting consisting of several files, this name will be used for the master document)
Returns:
a ConverterResult containing the converted document
Throws:
java.io.IOException - if some exception occurs while reading the document

convert

ConverterResult convert(java.io.File source,
                        java.lang.String sTargetFileName)
                        throws java.io.FileNotFoundException,
                               java.io.IOException
Convert a document

Parameters:
source - a File from which to read the source document.
sTargetFileName - the file name to use for the converted document (if the converted document is a compound document consisting consisting of several files, this name will be used for the master document)
Returns:
a ConverterResult containing the converted document
Throws:
java.io.FileNotFoundException - if the file does not exist
java.io.IOException - if some exception occurs while reading the document