Package org.xwiki.rendering.wikimodel
Interface IWemListenerDocument
-
- All Known Subinterfaces:
IWemListener
- All Known Implementing Classes:
AgregatingWemListener
,CompositeListener
,EmptyWemListener
,EventDumpListener
,JspWikiSerializer
,PrintInlineListener
,PrintListener
,PrintTextListener
,XWikiSerializer
,XWikiSerializer2
public interface IWemListenerDocument
Instances of this type are used to notify about parsed documents. This listener is called for top-level documents as well as for "embedded" documents found in the main document.Examples A: - a very simple document -------------------------------+-------------------------------------------- Source | Result -------------------------------+-------------------------------------------- = First Header = |+ section0 First paragraph. | + document | + seciontContent0 | + section1 | + header1 = First Header | + sectionContent1 | + paragraph = First paragraph. -------------------------------+-------------------------------------------- Examples B: - document with two headers (one section into another) -------------------------------+-------------------------------------------- Source | Result -------------------------------+-------------------------------------------- = First Header = |+ section0 First paragraph. | + document == Second Header == | + sectionContent0 Second paragraph. | + section1 | + header1 = First Header | + sectionContent1 | + paragraph = First paragraph. | + section2 | + header2 = Second Header | + sectionContent2 | + paragraph = Second paragraph. -------------------------------+-------------------------------------------- Examples C: - first section contains two sections of the second level -------------------------------+-------------------------------------------- Source | Result -------------------------------+-------------------------------------------- = First Header = |+ section0 First paragraph. | + document == Second Header == | + sectionContent0 Second paragraph. | + section1 == Third Header == | + header1 = First Header Third paragraph | + sectionContent1 | + paragraph = First paragraph. | + section2 | + header2 = Second Header | + sectionContent2 | + paragraph = Second paragraph. | + section2 | + header2 = Third Header | + sectionContent2 | + paragraph = Third paragraph. -------------------------------+-------------------------------------------- Examples D: - Two sections of the first level -------------------------------+-------------------------------------------- Source | Result -------------------------------+-------------------------------------------- = First Header = |+ section0 First paragraph. | + document == Second Header == | + sectionContent0 Second paragraph. | + section1 == Third Header == | + header1 = First Header Third paragraph | + sectionContent1 = Fourth Header = | + paragraph = First paragraph. Fourth paragr | + section2 | + header2 = Second Header | + sectionContent2 | + paragraph = Second paragraph. | + section2 | + header2 = Third Header | + sectionContent2 | + paragraph = Third paragraph. | + section1 | + header1 = Fourth Header | + sectionContent1 | + paragraph = Fourth paragraph. -------------------------------+--------------------------------------------
- Since:
- 4.0M1
- Version:
- $Id: 1996da09fd008e5466cd0f5fb9c742cf0061204f $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
beginDocument(WikiParameters params)
This method is called to notify about the beginning of the top-level parsed document or about the beginning of an embedded document (contained in the main one).void
beginHeader(int headerLevel, WikiParameters params)
This method is called to notify about a new section header found in the document.void
beginSection(int docLevel, int headerLevel, WikiParameters params)
This method is used to notify about the beginning of a section.void
beginSectionContent(int docLevel, int headerLevel, WikiParameters params)
This method is used to notify about the beginning of a section.void
endDocument(WikiParameters params)
This method is used to notify about the end of a top-level or an internal document.void
endHeader(int headerLevel, WikiParameters params)
This method is called to notify about the end of a section-level header.void
endSection(int docLevel, int headerLevel, WikiParameters params)
This method is used to notify about the end of a document section.void
endSectionContent(int docLevel, int headerLevel, WikiParameters params)
This method is used to notify about the end of a document section.
-
-
-
Method Detail
-
beginDocument
void beginDocument(WikiParameters params)
This method is called to notify about the beginning of the top-level parsed document or about the beginning of an embedded document (contained in the main one).- Parameters:
params
- the list of parameters for this event
-
beginHeader
void beginHeader(int headerLevel, WikiParameters params)
This method is called to notify about a new section header found in the document.- Parameters:
headerLevel
- the level of the found header; valid values: 1-6params
- the list of parameters for this event
-
beginSection
void beginSection(int docLevel, int headerLevel, WikiParameters params)
This method is used to notify about the beginning of a section. Document sections delimits a set of structural elements at the same "level". A new level starts with a new document or a new header.- Parameters:
docLevel
- the level (depth) of the document containing this sectionheaderLevel
- the level of the header defining this sectionparams
- the list of parameters for this event
-
beginSectionContent
void beginSectionContent(int docLevel, int headerLevel, WikiParameters params)
This method is used to notify about the beginning of a section. Document sections delimits a set of structural elements at the same "level". A new level starts with a new document or a new header.- Parameters:
docLevel
- the level (depth) of the document containing this sectionheaderLevel
- the level of the header defining this sectionparams
- the list of parameters for this event
-
endDocument
void endDocument(WikiParameters params)
This method is used to notify about the end of a top-level or an internal document.- Parameters:
params
- the list of parameters for this event
-
endHeader
void endHeader(int headerLevel, WikiParameters params)
This method is called to notify about the end of a section-level header.- Parameters:
headerLevel
- the level of the headerparams
- the list of parameters for this event
-
endSection
void endSection(int docLevel, int headerLevel, WikiParameters params)
This method is used to notify about the end of a document section.- Parameters:
docLevel
- the level (depth) of the document containing this sectionheaderLevel
- the level of the header defining this sectionparams
- the list of parameters for this event
-
endSectionContent
void endSectionContent(int docLevel, int headerLevel, WikiParameters params)
This method is used to notify about the end of a document section.- Parameters:
docLevel
- the level (depth) of the document containing this sectionheaderLevel
- the level of the header defining this sectionparams
- the list of parameters for this event
-
-