public class TocProcessor extends AbstractProcessor<org.seamless.xhtml.XHTML,org.seamless.xhtml.XHTML>
toc anchors with a generated table-of-contents.
The table-of-contents is generated by discovering all containers in an XHTML
document which are classed as a TocProcessor.SectionType.
Depending on their nesting level in the document (and not their name - all are equal), they
are added to the table-of-contents.
| Modifier and Type | Class and Description |
|---|---|
static class |
TocProcessor.SectionType |
protected class |
TocProcessor.TocItem |
| Modifier and Type | Field and Description |
|---|---|
static String |
SECTION_ELEMENT |
static String |
TYPE_TOC |
static String |
TYPE_TOC_ITEM |
static String |
TYPE_TOC_ITEM_LEVEL |
static String |
TYPE_TOC_ITEM_PREFIX |
READER_SUFFIX_MAP| Constructor and Description |
|---|
TocProcessor() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addChildTocItems(TocProcessor.TocItem currentTocItem,
org.seamless.xhtml.XHTMLElement currentElement) |
protected org.seamless.xhtml.XHTML |
addTableOfContents(org.seamless.xhtml.XHTML input,
Context context) |
protected String |
findNearestIdentifier(org.seamless.xhtml.XHTMLElement sectionElement) |
protected org.seamless.xhtml.XHTMLElement |
findNearestTitleElement(org.seamless.xhtml.XHTMLElement sectionElement) |
protected org.seamless.xhtml.XHTML |
generateToc(TocProcessor.TocItem root) |
org.seamless.xhtml.XHTML |
process(org.seamless.xhtml.XHTML input,
Context context) |
getParser, getReader, getXPathpublic static final String TYPE_TOC
public static final String TYPE_TOC_ITEM
public static final String TYPE_TOC_ITEM_PREFIX
public static final String TYPE_TOC_ITEM_LEVEL
public static final String SECTION_ELEMENT
public org.seamless.xhtml.XHTML process(org.seamless.xhtml.XHTML input,
Context context)
protected org.seamless.xhtml.XHTML addTableOfContents(org.seamless.xhtml.XHTML input,
Context context)
protected void addChildTocItems(TocProcessor.TocItem currentTocItem, org.seamless.xhtml.XHTMLElement currentElement)
protected String findNearestIdentifier(org.seamless.xhtml.XHTMLElement sectionElement)
protected org.seamless.xhtml.XHTMLElement findNearestTitleElement(org.seamless.xhtml.XHTMLElement sectionElement)
protected org.seamless.xhtml.XHTML generateToc(TocProcessor.TocItem root)
Copyright © 2015 4th Line GmbH, Switzerland. All Rights Reserved.