org.xwiki.rendering.wikimodel
Interface IWemListenerDocument

All Known Subinterfaces:
IWemListener
All Known Implementing Classes:
AgregatingWemListener, CompositeListener, ConfluenceExtendedWikiParser.EnhancedListener, EmptyWemListener, EventDumpListener, JspWikiSerializer, PrintInlineListener, PrintListener, PrintTextListener, TexSerializer, WemDocumentTagNotifier, WemTagNotifier, 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: 9d99bd46535ace2d48a41c34fe1608af19f8cc38 $

Method Summary
 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).


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-6
params - wiki parameters associated with the

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 section
headerLevel - the level of the header defining this section
params - parameters parameters of the document or the header

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 section
headerLevel - the level of the header defining this section
params - parameters parameters of the document or the header

endDocument

void endDocument(WikiParameters params)
This method is used to notify about the end of a top-level or an internal document.


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 header
params - wiki parameters of the header

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 section
headerLevel - the level of the header defining this section
params - parameters parameters of the document or the header

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 section
headerLevel - the level of the header defining this section
params - parameters parameters of the document or the header


Copyright © 2004-2012 XWiki. All Rights Reserved.