Class PackageDocumentWriter


  • public class PackageDocumentWriter
    extends PackageDocumentBase
    Writes the opf package document as defined by namespace http://www.idpf.org/2007/opf
    • Field Detail

      • log

        private static final org.slf4j.Logger log
    • Constructor Detail

      • PackageDocumentWriter

        public PackageDocumentWriter()
    • Method Detail

      • write

        public static void write​(EpubWriter epubWriter,
                                 org.xmlpull.v1.XmlSerializer serializer,
                                 Book book)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • writeSpine

        private static void writeSpine​(Book book,
                                       EpubWriter epubWriter,
                                       org.xmlpull.v1.XmlSerializer serializer)
                                throws java.lang.IllegalArgumentException,
                                       java.lang.IllegalStateException,
                                       java.io.IOException
        Writes the package's spine.
        Parameters:
        book -
        epubWriter -
        serializer -
        Throws:
        java.io.IOException
        java.lang.IllegalStateException
        java.lang.IllegalArgumentException
        javax.xml.stream.XMLStreamException
      • writeManifest

        private static void writeManifest​(Book book,
                                          EpubWriter epubWriter,
                                          org.xmlpull.v1.XmlSerializer serializer)
                                   throws java.lang.IllegalArgumentException,
                                          java.lang.IllegalStateException,
                                          java.io.IOException
        Throws:
        java.lang.IllegalArgumentException
        java.lang.IllegalStateException
        java.io.IOException
      • getAllResourcesSortById

        private static java.util.List<Resource> getAllResourcesSortById​(Book book)
      • writeItem

        private static void writeItem​(Book book,
                                      Resource resource,
                                      org.xmlpull.v1.XmlSerializer serializer)
                               throws java.lang.IllegalArgumentException,
                                      java.lang.IllegalStateException,
                                      java.io.IOException
        Writes a resources as an item element
        Parameters:
        resource -
        serializer -
        Throws:
        java.io.IOException
        java.lang.IllegalStateException
        java.lang.IllegalArgumentException
        javax.xml.stream.XMLStreamException
      • writeSpineItems

        private static void writeSpineItems​(Spine spine,
                                            org.xmlpull.v1.XmlSerializer serializer)
                                     throws java.lang.IllegalArgumentException,
                                            java.lang.IllegalStateException,
                                            java.io.IOException
        List all spine references
        Throws:
        java.io.IOException
        java.lang.IllegalStateException
        java.lang.IllegalArgumentException
      • writeGuide

        private static void writeGuide​(Book book,
                                       EpubWriter epubWriter,
                                       org.xmlpull.v1.XmlSerializer serializer)
                                throws java.lang.IllegalArgumentException,
                                       java.lang.IllegalStateException,
                                       java.io.IOException
        Throws:
        java.lang.IllegalArgumentException
        java.lang.IllegalStateException
        java.io.IOException
      • ensureCoverPageGuideReferenceWritten

        private static void ensureCoverPageGuideReferenceWritten​(Guide guide,
                                                                 EpubWriter epubWriter,
                                                                 org.xmlpull.v1.XmlSerializer serializer)
                                                          throws java.lang.IllegalArgumentException,
                                                                 java.lang.IllegalStateException,
                                                                 java.io.IOException
        Throws:
        java.lang.IllegalArgumentException
        java.lang.IllegalStateException
        java.io.IOException
      • writeGuideReference

        private static void writeGuideReference​(GuideReference reference,
                                                org.xmlpull.v1.XmlSerializer serializer)
                                         throws java.lang.IllegalArgumentException,
                                                java.lang.IllegalStateException,
                                                java.io.IOException
        Throws:
        java.lang.IllegalArgumentException
        java.lang.IllegalStateException
        java.io.IOException