Class ConverterResultImpl

  • All Implemented Interfaces:
    ConverterResult

    public class ConverterResultImpl
    extends java.lang.Object
    implements ConverterResult
    ConverterResultImpl is a straightforward implementation of ConverterResult
    • Constructor Detail

      • ConverterResultImpl

        public ConverterResultImpl()
        Construct a new ConverterResultImpl with empty content
    • Method Detail

      • reset

        public void reset()
        Resets all data. This empties all OutputFile and ContentEntry objects objects from this class. This allows reuse of a ConvertResult object.
      • addDocument

        public void addDocument​(OutputFile file)
        Adds an OutputFile to the list
        Parameters:
        file - The OutputFile to add.
      • iterator

        public java.util.Iterator<OutputFile> iterator()
        Gets an Iterator to access the List of OutputFile objects
        Specified by:
        iterator in interface ConverterResult
        Returns:
        The Iterator to access the List of OutputFile 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 this ConverterResult
        Specified by:
        getContent in interface ConverterResult
        Returns:
        list view of the content
      • setTitlePageFile

        public void setTitlePageFile​(ContentEntry entry)
        Define the entry which contains the title page
        Parameters:
        entry - the entry
      • 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 interface ConverterResult
        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 interface ConverterResult
        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 interface ConverterResult
        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 interface ConverterResult
        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 interface ConverterResult
        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
      • 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 interface ConverterResult
        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
      • setMetaData

        public void setMetaData​(MetaData metaData)
        Set the meta data of this ConverterResult
        Parameters:
        metaData - 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 interface ConverterResult
        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