Package writer2latex.api
Interface BatchConverter
-
- All Known Implementing Classes:
BatchConverterBase,BatchConverterImpl
public interface BatchConverterThis 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 theConverterFactory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidconvert(java.io.File source, java.io.File target, boolean bRecurse, BatchHandler handler)Convert a directory using the givenConverter(if none is given, all files will be ignored).OutputFilecreateIndexFile(java.lang.String sHeading, IndexPageEntry[] entries)Create an index page with specific entriesConfiggetConfig()Get the configuration interface for this batch convertervoidreadTemplate(java.io.File file)Read a template to use as a base for the index pages.voidreadTemplate(java.io.InputStream is)Read a template to use as a base for the index pages.voidsetConverter(Converter converter)Define aConverterimplementation to use for conversion of the individual documents.
-
-
-
Method Detail
-
getConfig
Config getConfig()
Get the configuration interface for this batch converter- Returns:
- the configuration
-
setConverter
void setConverter(Converter converter)
Define aConverterimplementation to use for conversion of the individual documents. If no converter is given, theconvertmethod cannot convert documents (but can still create index pages).- Parameters:
converter- theConverterto use
-
readTemplate
void readTemplate(java.io.InputStream is) throws java.io.IOExceptionRead a template to use as a base for the index pages. The format of the template depends on theBatchConverterimplementation.- Parameters:
is- anInputStreamfrom which to read the template- Throws:
java.io.IOException- if some exception occurs while reading the template
-
readTemplate
void readTemplate(java.io.File file) throws java.io.IOExceptionRead a template to use as a base for the index pages. The format of the template depends on theBatchConverterimplementation.- Parameters:
file- the 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
-
createIndexFile
OutputFile createIndexFile(java.lang.String sHeading, IndexPageEntry[] entries)
Create an index page with specific entries- Parameters:
sHeading- a heading describing the index pageentries- an array ofIndexPageEntryobjects (null entries are allowed, and will be ignored) describing the individual directories and documents
-
convert
void convert(java.io.File source, java.io.File target, boolean bRecurse, BatchHandler handler)Convert a directory using the givenConverter(if none is given, all files will be ignored). This method fails silently if you haven't set a converter.- Parameters:
source- aFilerepresenting the directory to converttarget- aFilerepresenting the directory to contain the converted documentsbRecurse- determines wether or not to recurse into subdirectorieshandler- a BatchHandler
-
-