Package org.daisy.dotify.api.formatter
Interface Context
-
- All Known Implementing Classes:
BlockContext,DefaultContext
public interface ContextProvides a formatter context that can be used to process context aware content.
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default IntegergetCurrentPage()Gets the current page number (one based) or null if not known.default IntegergetCurrentVolume()Gets the current volume number (one based) or null if not known.default IntegergetMetaPage()Gets the page number (one based) of the context described in the current context, or null if not available.default IntegergetMetaVolume()Gets the volume number (one based) of the context described in the current context, or null if not available.default IntegergetPagesInDocument()Gets the total number of pages contained in the document, or null if not known.default IntegergetPagesInVolume()Gets the total number of pages contained in the current volume, or null if not known.default IntegergetSheetsInDocument()Gets the total number of sheets contained in the document, or null if not known.default IntegergetSheetsInVolume()Gets the total number of sheets contained in the current volume, or null if not known.default IntegergetVolumeCount()Gets the volume count or null if not known.
-
-
-
Method Detail
-
getCurrentVolume
default Integer getCurrentVolume()
Gets the current volume number (one based) or null if not known.- Returns:
- returns the current volume number
-
getVolumeCount
default Integer getVolumeCount()
Gets the volume count or null if not known.- Returns:
- returns the volume count
-
getCurrentPage
default Integer getCurrentPage()
Gets the current page number (one based) or null if not known.- Returns:
- returns the current page number
-
getMetaVolume
default Integer getMetaVolume()
Gets the volume number (one based) of the context described in the current context, or null if not available.For example, an entry in a table of contents or an end note are examples where this method can be used to retrieve the original context.
- Returns:
- returns the meta volume number
-
getMetaPage
default Integer getMetaPage()
Gets the page number (one based) of the context described in the current context, or null if not available.For example,
- In the context of an entry in a table of contents,
if it is a standard entry (
toc-entryin OBFL), this method can be used to retrieve the page number of the block the entry is connected with. If it is a resumed entry (toc-entry-on-resumedin OBFL), this method would be used to retrieve the number of the first content page after the volume break that corresponds with this entry. - In the context of an end note (
itemin OBFL) this method can be used to retrieve the page number of the anchor that the item is connected with. - In the context of a group of end notes that are referenced from the
same page (
on-page-startandon-page-endin OBFL), this method can be used to retrieve the number of that page.
- Returns:
- returns the meta page number
- In the context of an entry in a table of contents,
if it is a standard entry (
-
getPagesInVolume
default Integer getPagesInVolume()
Gets the total number of pages contained in the current volume, or null if not known. This should include the volume's pre- and post-content.- Returns:
- returns the number of pages in the current volume, or null if not known.
-
getPagesInDocument
default Integer getPagesInDocument()
Gets the total number of pages contained in the document, or null if not known.- Returns:
- returns the number of pages in the document, or null if not known.
-
getSheetsInVolume
default Integer getSheetsInVolume()
Gets the total number of sheets contained in the current volume, or null if not known. This should include the volume's pre- and post-content.- Returns:
- returns the number of sheets in the current volume, or null if not known.
-
getSheetsInDocument
default Integer getSheetsInDocument()
Gets the total number of sheets contained in the document, or null if not known.- Returns:
- returns the number of sheets in the document, or null if not known.
-
-