Package writer2latex.api
Interface Converter
- All Known Implementing Classes:
Converter
,Converter
,ConverterBase
,ConverterPalette
,Xhtml10Converter
,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
Modifier and TypeMethodDescriptionConvert a documentconvert
(InputStream is, String sTargetFileName) Convert a documentGet the interface for the configuration of this convertervoid
readTemplate
(File file) Read a template to use as a base for the converted document.void
Read a template to use as a base for the converted document.void
Define aGraphicConverter
implementation to use for conversion of graphic files.
-
Method Details
-
getConfig
Config getConfig()Get the interface for the configuration of this converter- Returns:
- the configuration
-
setGraphicConverter
Define aGraphicConverter
implementation to use for conversion of graphic files. If no converter is specified, graphic files will not be converted into other formats.- Parameters:
gc
- theGraphicConverter
to use
-
readTemplate
Read a template to use as a base for the converted document. The format of the template depends on theConverter
implementation.- Parameters:
is
- anInputStream
from which to read the template- Throws:
IOException
- if some exception occurs while reading the template
-
readTemplate
Read a template to use as a base for the converted document. The format of the template depends on theConverter
implementation.- Parameters:
file
- a file from which to read the template- Throws:
IOException
- if the file does not exist or some exception occurs while reading the template
-
convert
Convert a document- Parameters:
is
- anInputStream
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:
IOException
- if some exception occurs while reading the document
-
convert
ConverterResult convert(File source, String sTargetFileName) throws FileNotFoundException, IOException Convert a document- Parameters:
source
- aFile
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:
FileNotFoundException
- if the file does not existIOException
- if some exception occurs while reading the document
-