writer2latex.api

Interface BatchConverter

Known Implementing Classes:
BatchConverterBase, BatchConverterImpl

public interface BatchConverter

This is an interface for a converter, which offers conversion of all OpenDocument (or OpenOffice.org 1.x) documents in a directory (and optionally subdirectories), creating index pages in a specific format. Instances of this interface are created using the ConverterFactory

Method Summary

void
convert(File source, File target, boolean bRecurse, BatchHandler handler)
Convert a directory using the given Converter (if none is given, all files will be ignored).
OutputFile
createIndexFile(String sHeading, IndexPageEntry[] entries)
Create an index page with specific entries
Config
getConfig()
Get the configuration interface for this batch converter
void
readTemplate(File file)
Read a template to use as a base for the index pages.
void
readTemplate(InputStream is)
Read a template to use as a base for the index pages.
void
setConverter(Converter converter)
Define a Converter implementation to use for conversion of the individual documents.

Method Details

convert

public void convert(File source,
                    File target,
                    boolean bRecurse,
                    BatchHandler handler)
Convert a directory using the given Converter (if none is given, all files will be ignored). This method fails silently if you haven't set a converter.
Parameters:
source - a File representing the directory to convert
target - a File representing the directory to contain the converted documents
bRecurse - determines wether or not to recurse into subdirectories
handler - a BatchHandler

createIndexFile

public OutputFile createIndexFile(String sHeading,
                                  IndexPageEntry[] entries)
Create an index page with specific entries
Parameters:
sHeading - a heading describing the index page
entries - an array of IndexPageEntry objects (null entries are allowed, and will be ignored) describing the individual directories and documents

getConfig

public Config getConfig()
Get the configuration interface for this batch converter
Returns:
the configuration

readTemplate

public void readTemplate(File file)
            throws IOException
Read a template to use as a base for the index pages. The format of the template depends on the BatchConverter implementation.
Parameters:
file - the 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 index pages. The format of the template depends on the BatchConverter implementation.
Parameters:
is - an InputStream from which to read the template

setConverter

public void setConverter(Converter converter)
Define a Converter implementation to use for conversion of the individual documents. If no converter is given, the convert method cannot convert documents (but can still create index pages).
Parameters:
converter - the Converter to use