org.teleal.lemma.processor.xhtml
Class TocProcessor
java.lang.Object
org.teleal.lemma.processor.AbstractProcessor<org.teleal.common.xhtml.XHTML,org.teleal.common.xhtml.XHTML>
org.teleal.lemma.processor.xhtml.TocProcessor
- All Implemented Interfaces:
- Processor<org.teleal.common.xhtml.XHTML,org.teleal.common.xhtml.XHTML>
public class TocProcessor
- extends AbstractProcessor<org.teleal.common.xhtml.XHTML,org.teleal.common.xhtml.XHTML>
Replaces 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.
- Author:
- Christian Bauer
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TYPE_TOC
public static final String TYPE_TOC
- See Also:
- Constant Field Values
TYPE_TOC_ITEM
public static final String TYPE_TOC_ITEM
- See Also:
- Constant Field Values
TYPE_TOC_ITEM_PREFIX
public static final String TYPE_TOC_ITEM_PREFIX
- See Also:
- Constant Field Values
TYPE_TOC_ITEM_LEVEL
public static final String TYPE_TOC_ITEM_LEVEL
- See Also:
- Constant Field Values
SECTION_ELEMENT
public static final String SECTION_ELEMENT
- See Also:
- Constant Field Values
TocProcessor
public TocProcessor()
process
public org.teleal.common.xhtml.XHTML process(org.teleal.common.xhtml.XHTML input,
Context context)
addTableOfContents
protected org.teleal.common.xhtml.XHTML addTableOfContents(org.teleal.common.xhtml.XHTML input,
Context context)
addChildTocItems
protected void addChildTocItems(TocProcessor.TocItem currentTocItem,
org.teleal.common.xhtml.XHTMLElement currentElement)
findNearestIdentifier
protected String findNearestIdentifier(org.teleal.common.xhtml.XHTMLElement sectionElement)
findNearestTitleElement
protected org.teleal.common.xhtml.XHTMLElement findNearestTitleElement(org.teleal.common.xhtml.XHTMLElement sectionElement)
generateToc
protected org.teleal.common.xhtml.XHTML generateToc(TocProcessor.TocItem root)
Copyright © 2010 Teleal GmbH, Switzerland. All Rights Reserved.