Package nl.siegmann.epublib.epub
Class PackageDocumentWriter
- java.lang.Object
-
- nl.siegmann.epublib.epub.PackageDocumentBase
-
- nl.siegmann.epublib.epub.PackageDocumentWriter
-
public class PackageDocumentWriter extends PackageDocumentBase
Writes the opf package document as defined by namespace http://www.idpf.org/2007/opf
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class nl.siegmann.epublib.epub.PackageDocumentBase
PackageDocumentBase.DCAttributes, PackageDocumentBase.DCTags, PackageDocumentBase.OPFAttributes, PackageDocumentBase.OPFTags, PackageDocumentBase.OPFValues
-
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.Loggerlog-
Fields inherited from class nl.siegmann.epublib.epub.PackageDocumentBase
BOOK_ID_ID, dateFormat, NAMESPACE_DUBLIN_CORE, NAMESPACE_OPF, PREFIX_DUBLIN_CORE, PREFIX_OPF
-
-
Constructor Summary
Constructors Constructor Description PackageDocumentWriter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static voidensureCoverPageGuideReferenceWritten(Guide guide, EpubWriter epubWriter, org.xmlpull.v1.XmlSerializer serializer)private static java.util.List<Resource>getAllResourcesSortById(Book book)static voidwrite(EpubWriter epubWriter, org.xmlpull.v1.XmlSerializer serializer, Book book)private static voidwriteGuide(Book book, EpubWriter epubWriter, org.xmlpull.v1.XmlSerializer serializer)private static voidwriteGuideReference(GuideReference reference, org.xmlpull.v1.XmlSerializer serializer)private static voidwriteItem(Book book, Resource resource, org.xmlpull.v1.XmlSerializer serializer)Writes a resources as an item elementprivate static voidwriteManifest(Book book, EpubWriter epubWriter, org.xmlpull.v1.XmlSerializer serializer)private static voidwriteSpine(Book book, EpubWriter epubWriter, org.xmlpull.v1.XmlSerializer serializer)Writes the package's spine.private static voidwriteSpineItems(Spine spine, org.xmlpull.v1.XmlSerializer serializer)List all spine references
-
-
-
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.IOExceptionjava.lang.IllegalStateExceptionjava.lang.IllegalArgumentExceptionjavax.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.IllegalArgumentExceptionjava.lang.IllegalStateExceptionjava.io.IOException
-
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.IOExceptionjava.lang.IllegalStateExceptionjava.lang.IllegalArgumentExceptionjavax.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.IOExceptionjava.lang.IllegalStateExceptionjava.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.IllegalArgumentExceptionjava.lang.IllegalStateExceptionjava.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.IllegalArgumentExceptionjava.lang.IllegalStateExceptionjava.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.IllegalArgumentExceptionjava.lang.IllegalStateExceptionjava.io.IOException
-
-