Class EpubProcessorSupport


  • public class EpubProcessorSupport
    extends java.lang.Object
    Various low-level support methods for reading/writing epubs.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static javax.xml.parsers.DocumentBuilderFactory documentBuilderFactory  
      private static org.slf4j.Logger log  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static javax.xml.parsers.DocumentBuilder createDocumentBuilder()
      Creates a DocumentBuilder that looks up dtd's and schema's from epublib's classpath.
      static org.xmlpull.v1.XmlSerializer createXmlSerializer​(java.io.OutputStream out)  
      static org.xmlpull.v1.XmlSerializer createXmlSerializer​(java.io.Writer out)  
      javax.xml.parsers.DocumentBuilderFactory getDocumentBuilderFactory()  
      static org.xml.sax.EntityResolver getEntityResolver()
      Gets an EntityResolver that loads dtd's and such from the epublib classpath.
      private static void init()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • log

        private static final org.slf4j.Logger log
      • documentBuilderFactory

        protected static javax.xml.parsers.DocumentBuilderFactory documentBuilderFactory
    • Constructor Detail

      • EpubProcessorSupport

        public EpubProcessorSupport()
    • Method Detail

      • init

        private static void init()
      • createXmlSerializer

        public static org.xmlpull.v1.XmlSerializer createXmlSerializer​(java.io.OutputStream out)
                                                                throws java.io.UnsupportedEncodingException
        Throws:
        java.io.UnsupportedEncodingException
      • createXmlSerializer

        public static org.xmlpull.v1.XmlSerializer createXmlSerializer​(java.io.Writer out)
      • getEntityResolver

        public static org.xml.sax.EntityResolver getEntityResolver()
        Gets an EntityResolver that loads dtd's and such from the epublib classpath. In order to enable the loading of relative urls the given EntityResolver contains the previousLocation. Because of a new EntityResolver is created every time this method is called. Fortunately the EntityResolver created uses up very little memory per instance.
        Returns:
        an EntityResolver that loads dtd's and such from the epublib classpath.
      • getDocumentBuilderFactory

        public javax.xml.parsers.DocumentBuilderFactory getDocumentBuilderFactory()
      • createDocumentBuilder

        public static javax.xml.parsers.DocumentBuilder createDocumentBuilder()
        Creates a DocumentBuilder that looks up dtd's and schema's from epublib's classpath.
        Returns:
        a DocumentBuilder that looks up dtd's and schema's from epublib's classpath.