writer2latex.base

Class ConverterBase

Implemented Interfaces:
Converter
Known Direct Subclasses:
Converter, Converter, ConverterPalette

public abstract class ConverterBase
extends java.lang.Object
implements Converter

Abstract base implementation of writer2latex.api.Converter

Field Summary

protected ConvertData
convertData
protected GraphicConverter
graphicConverter
protected ImageLoader
imageLoader
protected MetaData
metaData
protected OfficeDocument
odDoc
protected OfficeReader
ofr
protected String
sTargetFileName

Constructor Summary

ConverterBase()

Method Summary

void
addDocument(OutputFile doc)
ConverterResult
convert(File source, String sTargetFileName)
Convert a document
ConverterResult
convert(InputStream is, String sTargetFileName)
Convert a document
abstract void
convertInner()
EmbeddedObject
getEmbeddedObject(String sHref)
ImageLoader
getImageLoader()
MetaData
getMetaData()
void
readTemplate(File file)
Read a template to use as a base for the converted document.
void
readTemplate(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.

Field Details

convertData

protected ConvertData convertData

graphicConverter

protected GraphicConverter graphicConverter

imageLoader

protected ImageLoader imageLoader

metaData

protected MetaData metaData

odDoc

protected OfficeDocument odDoc

ofr

protected OfficeReader ofr

sTargetFileName

protected String sTargetFileName

Constructor Details

ConverterBase

public ConverterBase()

Method Details

addDocument

public void addDocument(OutputFile doc)

convert

public ConverterResult convert(File source,
                               String sTargetFileName)
            throws FileNotFoundException,
                   IOException
Convert a document
Specified by:
convert in interface Converter
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

convert

public ConverterResult convert(InputStream is,
                               String sTargetFileName)
            throws IOException
Convert a document
Specified by:
convert in interface Converter
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

convertInner

public abstract void convertInner()
            throws IOException

getEmbeddedObject

public EmbeddedObject getEmbeddedObject(String sHref)

getImageLoader

public ImageLoader getImageLoader()

getMetaData

public MetaData getMetaData()

readTemplate

public void readTemplate(File file)
            throws IOException
Read a template to use as a base for the converted document. The format of the template depends on the Converter implementation.
Specified by:
readTemplate in interface Converter
Parameters:
file - a file from which to read the template

readTemplate

public void readTemplate(InputStream is)
            throws IOException
Read a template to use as a base for the converted document. The format of the template depends on the Converter implementation.
Specified by:
readTemplate in interface Converter
Parameters:
is - an InputStream from which to read the template

setGraphicConverter

public void setGraphicConverter(GraphicConverter graphicConverter)
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.
Specified by:
setGraphicConverter in interface Converter
Parameters: