Package writer2latex.base
Class ConverterBase
- java.lang.Object
-
- writer2latex.base.ConverterBase
-
- All Implemented Interfaces:
Converter
- Direct Known Subclasses:
Converter,Converter,ConverterPalette
public abstract class ConverterBase extends java.lang.Object implements Converter
Abstract base implementation of
writer2latex.api.Converter
-
-
Field Summary
Fields Modifier and Type Field Description protected ConvertDataconvertDataprotected GraphicConvertergraphicConverterprotected ImageLoaderimageLoaderprotected MetaDatametaDataprotected OfficeDocumentodDocprotected OfficeReaderofrprotected java.lang.StringsTargetFileName
-
Constructor Summary
Constructors Constructor Description ConverterBase()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddDocument(OutputFile doc)ConverterResultconvert(java.io.File source, java.lang.String sTargetFileName)Convert a documentConverterResultconvert(java.io.InputStream is, java.lang.String sTargetFileName)Convert a documentabstract voidconvertInner()EmbeddedObjectgetEmbeddedObject(java.lang.String sHref)ImageLoadergetImageLoader()MetaDatagetMetaData()voidreadTemplate(java.io.File file)Read a template to use as a base for the converted document.voidreadTemplate(java.io.InputStream is)Read a template to use as a base for the converted document.voidsetGraphicConverter(GraphicConverter graphicConverter)Define aGraphicConverterimplementation to use for conversion of graphic files.
-
-
-
Field Detail
-
graphicConverter
protected GraphicConverter graphicConverter
-
odDoc
protected OfficeDocument odDoc
-
ofr
protected OfficeReader ofr
-
metaData
protected MetaData metaData
-
imageLoader
protected ImageLoader imageLoader
-
sTargetFileName
protected java.lang.String sTargetFileName
-
convertData
protected ConvertData convertData
-
-
Method Detail
-
setGraphicConverter
public void setGraphicConverter(GraphicConverter graphicConverter)
Description copied from interface:ConverterDefine aGraphicConverterimplementation to use for conversion of graphic files. If no converter is specified, graphic files will not be converted into other formats.- Specified by:
setGraphicConverterin interfaceConverter- Parameters:
graphicConverter- theGraphicConverterto use
-
readTemplate
public void readTemplate(java.io.InputStream is) throws java.io.IOExceptionDescription copied from interface:ConverterRead a template to use as a base for the converted document. The format of the template depends on theConverterimplementation.- Specified by:
readTemplatein interfaceConverter- Parameters:
is- anInputStreamfrom which to read the template- Throws:
java.io.IOException- if some exception occurs while reading the template
-
readTemplate
public void readTemplate(java.io.File file) throws java.io.IOExceptionDescription copied from interface:ConverterRead a template to use as a base for the converted document. The format of the template depends on theConverterimplementation.- Specified by:
readTemplatein interfaceConverter- 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
-
convert
public ConverterResult convert(java.io.File source, java.lang.String sTargetFileName) throws java.io.FileNotFoundException, java.io.IOException
Description copied from interface:ConverterConvert a document- Specified by:
convertin interfaceConverter- Parameters:
source- aFilefrom 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
ConverterResultcontaining the converted document - Throws:
java.io.FileNotFoundException- if the file does not existjava.io.IOException- if some exception occurs while reading the document
-
convert
public ConverterResult convert(java.io.InputStream is, java.lang.String sTargetFileName) throws java.io.IOException
Description copied from interface:ConverterConvert a document- Specified by:
convertin interfaceConverter- Parameters:
is- anInputStreamfrom 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
ConverterResultcontaining the converted document - Throws:
java.io.IOException- if some exception occurs while reading the document
-
convertInner
public abstract void convertInner() throws java.io.IOException- Throws:
java.io.IOException
-
getMetaData
public MetaData getMetaData()
-
getImageLoader
public ImageLoader getImageLoader()
-
addDocument
public void addDocument(OutputFile doc)
-
getEmbeddedObject
public EmbeddedObject getEmbeddedObject(java.lang.String sHref)
-
-