Class NCXDocument


  • public class NCXDocument
    extends java.lang.Object
    Writes the ncx document as defined by namespace http://www.daisy.org/z3986/2005/ncx/
    • Constructor Detail

      • NCXDocument

        public NCXDocument()
    • Method Detail

      • readTOCReferences

        private static java.util.List<TOCReference> readTOCReferences​(org.w3c.dom.NodeList navpoints,
                                                                      Book book)
      • readTOCReference

        static TOCReference readTOCReference​(org.w3c.dom.Element navpointElement,
                                             Book book)
      • readNavReference

        private static java.lang.String readNavReference​(org.w3c.dom.Element navpointElement)
      • readNavLabel

        private static java.lang.String readNavLabel​(org.w3c.dom.Element navpointElement)
      • write

        public static void write​(EpubWriter epubWriter,
                                 Book book,
                                 java.util.zip.ZipOutputStream resultStream)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • write

        public static void write​(org.xmlpull.v1.XmlSerializer xmlSerializer,
                                 Book book)
                          throws java.lang.IllegalArgumentException,
                                 java.lang.IllegalStateException,
                                 java.io.IOException
        Generates a resource containing an xml document containing the table of contents of the book in ncx format.
        Parameters:
        xmlSerializer - the serializer used
        book - the book to serialize
        Throws:
        javax.xml.stream.FactoryConfigurationError
        java.io.IOException
        java.lang.IllegalStateException
        java.lang.IllegalArgumentException
      • createNCXResource

        public static Resource createNCXResource​(Book book)
                                          throws java.lang.IllegalArgumentException,
                                                 java.lang.IllegalStateException,
                                                 java.io.IOException
        Throws:
        java.lang.IllegalArgumentException
        java.lang.IllegalStateException
        java.io.IOException
      • createNCXResource

        public static Resource createNCXResource​(java.util.List<Identifier> identifiers,
                                                 java.lang.String title,
                                                 java.util.List<Author> authors,
                                                 TableOfContents tableOfContents)
                                          throws java.lang.IllegalArgumentException,
                                                 java.lang.IllegalStateException,
                                                 java.io.IOException
        Throws:
        java.lang.IllegalArgumentException
        java.lang.IllegalStateException
        java.io.IOException
      • write

        public static void write​(org.xmlpull.v1.XmlSerializer serializer,
                                 java.util.List<Identifier> identifiers,
                                 java.lang.String title,
                                 java.util.List<Author> authors,
                                 TableOfContents tableOfContents)
                          throws java.lang.IllegalArgumentException,
                                 java.lang.IllegalStateException,
                                 java.io.IOException
        Throws:
        java.lang.IllegalArgumentException
        java.lang.IllegalStateException
        java.io.IOException
      • writeMetaElement

        private static void writeMetaElement​(java.lang.String dtbName,
                                             java.lang.String content,
                                             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
      • writeNavPoints

        private static int writeNavPoints​(java.util.List<TOCReference> tocReferences,
                                          int playOrder,
                                          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
      • writeNavPointStart

        private static void writeNavPointStart​(TOCReference tocReference,
                                               int playOrder,
                                               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
      • writeNavPointEnd

        private static void writeNavPointEnd​(TOCReference tocReference,
                                             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