public abstract class ConverterBase extends java.lang.Object implements Converter
Abstract base implementation of writer2latex.api.Converter
Modifier and Type | Field and Description |
---|---|
protected ConverterResultImpl |
converterResult |
protected GraphicConverter |
graphicConverter |
protected ImageLoader |
imageLoader |
protected MetaData |
metaData |
protected OfficeDocument |
odDoc |
protected OfficeReader |
ofr |
protected java.lang.String |
sTargetFileName |
Constructor and Description |
---|
ConverterBase() |
Modifier and Type | Method and Description |
---|---|
void |
addDocument(OutputFile doc) |
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
|
abstract void |
convertInner() |
EmbeddedObject |
getEmbeddedObject(java.lang.String sHref) |
ImageLoader |
getImageLoader() |
MetaData |
getMetaData() |
void |
readResource(java.io.File file,
java.lang.String sFileName,
java.lang.String sMediaType)
Read a style sheet to include with the converted document.
|
void |
readResource(java.io.InputStream is,
java.lang.String sFileName,
java.lang.String sMediaType)
Read a resource to include with the converted document.
|
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 graphicConverter)
Define a
GraphicConverter implementation to use for
conversion of graphic files. |
protected GraphicConverter graphicConverter
protected OfficeDocument odDoc
protected OfficeReader ofr
protected MetaData metaData
protected ImageLoader imageLoader
protected java.lang.String sTargetFileName
protected ConverterResultImpl converterResult
public void setGraphicConverter(GraphicConverter graphicConverter)
Converter
GraphicConverter
implementation to use for
conversion of graphic files. If no converter is specified, graphic
files will not be converted into other formats.setGraphicConverter
in interface Converter
graphicConverter
- the GraphicConverter
to usepublic void readTemplate(java.io.InputStream is) throws java.io.IOException
Converter
Converter
implementation.readTemplate
in interface Converter
is
- an InputStream
from which to read the templatejava.io.IOException
- if some exception occurs while reading the templatepublic void readTemplate(java.io.File file) throws java.io.IOException
Converter
Converter
implementation.readTemplate
in interface Converter
file
- a file from which to read the templatejava.io.IOException
- if the file does not exist or some exception occurs
while reading the templatepublic void readStyleSheet(java.io.InputStream is) throws java.io.IOException
Converter
Converter
implementation.readStyleSheet
in interface Converter
is
- an InputStream
from which to read the style sheetjava.io.IOException
- if some exception occurs while reading the style sheetpublic void readStyleSheet(java.io.File file) throws java.io.IOException
Converter
Converter
implementation.readStyleSheet
in interface Converter
file
- a file from which to read the style sheetjava.io.IOException
- if the file does not exist or some exception occurs
while reading the style sheetpublic void readResource(java.io.InputStream is, java.lang.String sFileName, java.lang.String sMediaType) throws java.io.IOException
Converter
readResource
in interface Converter
is
- an InputStream
from which to read the resourcesFileName
- the file name to use for the resourcesMediaType
- the media type of the resource, if null the media type will be guessed from the file namejava.io.IOException
- if some exception occurs while reading the resourcepublic void readResource(java.io.File file, java.lang.String sFileName, java.lang.String sMediaType) throws java.io.IOException
Converter
readResource
in interface Converter
file
- a file from which to read the style sheetsFileName
- the file name to use for the resourcesMediaType
- the media type of the resource, if null the media type will be guessed from the file namejava.io.IOException
- if the file does not exist or some exception occurs
while reading the resourcepublic ConverterResult convert(java.io.File source, java.lang.String sTargetFileName) throws java.io.FileNotFoundException, java.io.IOException
Converter
convert
in interface Converter
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)ConverterResult
containing the converted documentjava.io.FileNotFoundException
- if the file does not existjava.io.IOException
- if some exception occurs while reading the documentpublic ConverterResult convert(java.io.InputStream is, java.lang.String sTargetFileName) throws java.io.IOException
Converter
convert
in interface Converter
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)ConverterResult
containing the converted documentjava.io.IOException
- if some exception occurs while reading the documentpublic abstract void convertInner() throws java.io.IOException
java.io.IOException
public MetaData getMetaData()
public ImageLoader getImageLoader()
public void addDocument(OutputFile doc)
public EmbeddedObject getEmbeddedObject(java.lang.String sHref)