Package org.daisy.dotify.api.formatter
Interface Context
-
- All Known Implementing Classes:
BlockContext
,DefaultContext
public interface Context
Provides 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 Integer
getCurrentPage()
Gets the current page number (one based) or null if not known.default Integer
getCurrentVolume()
Gets the current volume number (one based) or null if not known.default Integer
getMetaPage()
Gets the page number (one based) of the context described in the current context, or null if not available.default Integer
getMetaVolume()
Gets the volume number (one based) of the context described in the current context, or null if not available.default Integer
getPagesInDocument()
Gets the total number of pages contained in the document, or null if not known.default Integer
getPagesInVolume()
Gets the total number of pages contained in the current volume, or null if not known.default Integer
getSheetsInDocument()
Gets the total number of sheets contained in the document, or null if not known.default Integer
getSheetsInVolume()
Gets the total number of sheets contained in the current volume, or null if not known.default Integer
getVolumeCount()
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-entry
in 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-resumed
in 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 (
item
in 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-start
andon-page-end
in 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.
-
-