Package writer2latex.base
Class ConverterResultImpl
- java.lang.Object
-
- writer2latex.base.ConverterResultImpl
-
- All Implemented Interfaces:
ConverterResult
public class ConverterResultImpl extends java.lang.Object implements ConverterResult
ConverterResultImpl
is a straightforward implementation ofConverterResult
-
-
Constructor Summary
Constructors Constructor Description ConverterResultImpl()
Construct a newConverterResultImpl
with empty content
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addContentEntry(ContentEntry entry)
Add an entry to the "external" table of contentsvoid
addDocument(OutputFile file)
Adds anOutputFile
to the listContentEntry
getBibliographyFile()
Get the entry which contains the bibliographyjava.util.List<ContentEntry>
getContent()
Get the content table (based on headings) for thisConverterResult
ContentEntry
getCoverFile()
Get the entry which contains the cover (which usually will contain a cover image)ContentEntry
getCoverImageFile()
Get the entry which contains the actual cover imageContentEntry
getIndexFile()
Get the entry which contains the alphabetical indexContentEntry
getLofFile()
Get the entry which contains the list of figuresContentEntry
getLotFile()
Get the entry which contains the list of tablesOutputFile
getMasterDocument()
Get the first master documentMetaData
getMetaData()
Get the meta data of thisConverterResult
ContentEntry
getTextFile()
Get the entry which contains the start of the actual text (the first chapter, or simply the start of the document if there are no headings)ContentEntry
getTitlePageFile()
Get the entry which contains the table pageContentEntry
getTocFile()
Get the entry which contains the table of contentsjava.util.Iterator<OutputFile>
iterator()
Gets anIterator
to access theList
ofOutputFile
objectsvoid
reset()
Resets all data.void
setBibliographyFile(ContentEntry entry)
Define the entry which contains the bibliographyvoid
setCoverFile(ContentEntry entry)
Define the entry which contains the covervoid
setCoverImageFile(ContentEntry entry)
Define the entry which contains the cover imagevoid
setIndexFile(ContentEntry entry)
Define the entry which contains the alphabetical indexvoid
setLofFile(ContentEntry entry)
Define the entry which contains the list of figuresvoid
setLotFile(ContentEntry entry)
Define the entry which contains the list of tablesvoid
setMetaData(MetaData metaData)
Set the meta data of thisConverterResult
void
setTextFile(ContentEntry entry)
Define the entry which contains the main text filevoid
setTitlePageFile(ContentEntry entry)
Define the entry which contains the title pagevoid
setTocFile(ContentEntry entry)
Define the entry which contains the table of contentsvoid
write(java.io.File dir)
Write all files to a given directory
-
-
-
Method Detail
-
reset
public void reset()
Resets all data. This empties allOutputFile
andContentEntry
objects objects from this class. This allows reuse of aConvertResult
object.
-
addDocument
public void addDocument(OutputFile file)
Adds anOutputFile
to the list- Parameters:
file
- TheOutputFile
to add.
-
getMasterDocument
public OutputFile getMasterDocument()
Get the first master document- Specified by:
getMasterDocument
in interfaceConverterResult
- Returns:
OutputFile
the master document
-
iterator
public java.util.Iterator<OutputFile> iterator()
Gets anIterator
to access theList
ofOutputFile
objects- Specified by:
iterator
in interfaceConverterResult
- Returns:
- The
Iterator
to access theList
ofOutputFile
objects.
-
addContentEntry
public void addContentEntry(ContentEntry entry)
Add an entry to the "external" table of contents- Parameters:
entry
- the entry to add
-
getContent
public java.util.List<ContentEntry> getContent()
Description copied from interface:ConverterResult
Get the content table (based on headings) for thisConverterResult
- Specified by:
getContent
in interfaceConverterResult
- Returns:
- list view of the content
-
setTitlePageFile
public void setTitlePageFile(ContentEntry entry)
Define the entry which contains the title page- Parameters:
entry
- the entry
-
getTitlePageFile
public ContentEntry getTitlePageFile()
Description copied from interface:ConverterResult
Get the entry which contains the table page- Specified by:
getTitlePageFile
in interfaceConverterResult
- Returns:
- the entry or null if there is no title page
-
setTextFile
public void setTextFile(ContentEntry entry)
Define the entry which contains the main text file- Parameters:
entry
- the entry
-
getTextFile
public ContentEntry getTextFile()
Description copied from interface:ConverterResult
Get the entry which contains the start of the actual text (the first chapter, or simply the start of the document if there are no headings)- Specified by:
getTextFile
in interfaceConverterResult
- Returns:
- the entry
-
setTocFile
public void setTocFile(ContentEntry entry)
Define the entry which contains the table of contents- Parameters:
entry
- the entry
-
getTocFile
public ContentEntry getTocFile()
Description copied from interface:ConverterResult
Get the entry which contains the table of contents- Specified by:
getTocFile
in interfaceConverterResult
- Returns:
- the entry or null if a table of content does not exist
-
setLofFile
public void setLofFile(ContentEntry entry)
Define the entry which contains the list of figures- Parameters:
entry
- the entry
-
getLofFile
public ContentEntry getLofFile()
Description copied from interface:ConverterResult
Get the entry which contains the list of figures- Specified by:
getLofFile
in interfaceConverterResult
- Returns:
- the entry or null if a list of figures does not exist
-
setLotFile
public void setLotFile(ContentEntry entry)
Define the entry which contains the list of tables- Parameters:
entry
- the entry
-
getLotFile
public ContentEntry getLotFile()
Description copied from interface:ConverterResult
Get the entry which contains the list of tables- Specified by:
getLotFile
in interfaceConverterResult
- Returns:
- the entry or null if a list of tables does not exist
-
setIndexFile
public void setIndexFile(ContentEntry entry)
Define the entry which contains the alphabetical index- Parameters:
entry
- the entry
-
getIndexFile
public ContentEntry getIndexFile()
Description copied from interface:ConverterResult
Get the entry which contains the alphabetical index- Specified by:
getIndexFile
in interfaceConverterResult
- Returns:
- the entry or null if an alphabetical index does not exist
-
setBibliographyFile
public void setBibliographyFile(ContentEntry entry)
Define the entry which contains the bibliography- Parameters:
entry
- the entry
-
getBibliographyFile
public ContentEntry getBibliographyFile()
Description copied from interface:ConverterResult
Get the entry which contains the bibliography- Specified by:
getBibliographyFile
in interfaceConverterResult
- Returns:
- the entry or null if a bibliography does not exist
-
setCoverFile
public void setCoverFile(ContentEntry entry)
Define the entry which contains the cover- Parameters:
entry
- the entry
-
getCoverFile
public ContentEntry getCoverFile()
Description copied from interface:ConverterResult
Get the entry which contains the cover (which usually will contain a cover image)- Specified by:
getCoverFile
in interfaceConverterResult
- Returns:
- the entry or null if a cover does not exist
-
setCoverImageFile
public void setCoverImageFile(ContentEntry entry)
Define the entry which contains the cover image- Parameters:
entry
- the entry
-
getCoverImageFile
public ContentEntry getCoverImageFile()
Description copied from interface:ConverterResult
Get the entry which contains the actual cover image- Specified by:
getCoverImageFile
in interfaceConverterResult
- Returns:
- the entry or null if a cover image does not exist
-
setMetaData
public void setMetaData(MetaData metaData)
Set the meta data of thisConverterResult
- Parameters:
metaData
- the meta data
-
getMetaData
public MetaData getMetaData()
Get the meta data of thisConverterResult
- Specified by:
getMetaData
in interfaceConverterResult
- Returns:
- the meta data
-
write
public void write(java.io.File dir) throws java.io.IOException
Write all files to a given directory- Specified by:
write
in interfaceConverterResult
- Parameters:
dir
- the directory to use- Throws:
java.io.IOException
- if the directory does not exist or one or more files could not be written
-
-