Package nl.siegmann.epublib.epub
Class NCXDocument
- java.lang.Object
-
- nl.siegmann.epublib.epub.NCXDocument
-
public class NCXDocument extends java.lang.ObjectWrites the ncx document as defined by namespace http://www.daisy.org/z3986/2005/ncx/
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static interfaceNCXDocument.NCXAttributesprivate static interfaceNCXDocument.NCXAttributeValuesprivate static interfaceNCXDocument.NCXTags
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_NCX_HREFprivate static org.slf4j.Loggerlogstatic java.lang.StringNAMESPACE_NCXstatic java.lang.StringNCX_ITEM_IDstatic java.lang.StringPREFIX_DTBstatic java.lang.StringPREFIX_NCX
-
Constructor Summary
Constructors Constructor Description NCXDocument()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ResourcecreateNCXResource(java.util.List<Identifier> identifiers, java.lang.String title, java.util.List<Author> authors, TableOfContents tableOfContents)static ResourcecreateNCXResource(Book book)static Resourceread(Book book, EpubReader epubReader)private static java.lang.StringreadNavLabel(org.w3c.dom.Element navpointElement)private static java.lang.StringreadNavReference(org.w3c.dom.Element navpointElement)(package private) static TOCReferencereadTOCReference(org.w3c.dom.Element navpointElement, Book book)private static java.util.List<TOCReference>readTOCReferences(org.w3c.dom.NodeList navpoints, Book book)static voidwrite(EpubWriter epubWriter, Book book, java.util.zip.ZipOutputStream resultStream)static voidwrite(org.xmlpull.v1.XmlSerializer serializer, java.util.List<Identifier> identifiers, java.lang.String title, java.util.List<Author> authors, TableOfContents tableOfContents)static voidwrite(org.xmlpull.v1.XmlSerializer xmlSerializer, Book book)Generates a resource containing an xml document containing the table of contents of the book in ncx format.private static voidwriteMetaElement(java.lang.String dtbName, java.lang.String content, org.xmlpull.v1.XmlSerializer serializer)private static voidwriteNavPointEnd(TOCReference tocReference, org.xmlpull.v1.XmlSerializer serializer)private static intwriteNavPoints(java.util.List<TOCReference> tocReferences, int playOrder, org.xmlpull.v1.XmlSerializer serializer)private static voidwriteNavPointStart(TOCReference tocReference, int playOrder, org.xmlpull.v1.XmlSerializer serializer)
-
-
-
Field Detail
-
NAMESPACE_NCX
public static final java.lang.String NAMESPACE_NCX
- See Also:
- Constant Field Values
-
PREFIX_NCX
public static final java.lang.String PREFIX_NCX
- See Also:
- Constant Field Values
-
NCX_ITEM_ID
public static final java.lang.String NCX_ITEM_ID
- See Also:
- Constant Field Values
-
DEFAULT_NCX_HREF
public static final java.lang.String DEFAULT_NCX_HREF
- See Also:
- Constant Field Values
-
PREFIX_DTB
public static final java.lang.String PREFIX_DTB
- See Also:
- Constant Field Values
-
log
private static final org.slf4j.Logger log
-
-
Method Detail
-
read
public static Resource read(Book book, EpubReader epubReader)
-
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.IOExceptionGenerates a resource containing an xml document containing the table of contents of the book in ncx format.- Parameters:
xmlSerializer- the serializer usedbook- the book to serialize- Throws:
javax.xml.stream.FactoryConfigurationErrorjava.io.IOExceptionjava.lang.IllegalStateExceptionjava.lang.IllegalArgumentException
-
createNCXResource
public static Resource createNCXResource(Book book) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.io.IOException
- Throws:
java.lang.IllegalArgumentExceptionjava.lang.IllegalStateExceptionjava.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.IllegalArgumentExceptionjava.lang.IllegalStateExceptionjava.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.IllegalArgumentExceptionjava.lang.IllegalStateExceptionjava.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.IllegalArgumentExceptionjava.lang.IllegalStateExceptionjava.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.IllegalArgumentExceptionjava.lang.IllegalStateExceptionjava.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.IllegalArgumentExceptionjava.lang.IllegalStateExceptionjava.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.IllegalArgumentExceptionjava.lang.IllegalStateExceptionjava.io.IOException
-
-