Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
IWemListenerDocument | 108 | 0 | - | 0 | 0 |
1 | /* | |
2 | * See the NOTICE file distributed with this work for additional | |
3 | * information regarding copyright ownership. | |
4 | * | |
5 | * This is free software; you can redistribute it and/or modify it | |
6 | * under the terms of the GNU Lesser General Public License as | |
7 | * published by the Free Software Foundation; either version 2.1 of | |
8 | * the License, or (at your option) any later version. | |
9 | * | |
10 | * This software is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | * Lesser General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public | |
16 | * License along with this software; if not, write to the Free | |
17 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
18 | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |
19 | */ | |
20 | package org.xwiki.rendering.wikimodel; | |
21 | ||
22 | /** | |
23 | * Instances of this type are used to notify about parsed documents. This listener is called for top-level documents as | |
24 | * well as for "embedded" documents found in the main document. | |
25 | * | |
26 | * <pre> | |
27 | * | |
28 | * Examples A: - a very simple document | |
29 | * -------------------------------+-------------------------------------------- | |
30 | * Source | Result | |
31 | * -------------------------------+-------------------------------------------- | |
32 | * = First Header = |+ section0 | |
33 | * First paragraph. | + document | |
34 | * | + seciontContent0 | |
35 | * | + section1 | |
36 | * | + header1 = First Header | |
37 | * | + sectionContent1 | |
38 | * | + paragraph = First paragraph. | |
39 | * -------------------------------+-------------------------------------------- | |
40 | * | |
41 | * Examples B: - document with two headers (one section into another) | |
42 | * -------------------------------+-------------------------------------------- | |
43 | * Source | Result | |
44 | * -------------------------------+-------------------------------------------- | |
45 | * = First Header = |+ section0 | |
46 | * First paragraph. | + document | |
47 | * == Second Header == | + sectionContent0 | |
48 | * Second paragraph. | + section1 | |
49 | * | + header1 = First Header | |
50 | * | + sectionContent1 | |
51 | * | + paragraph = First paragraph. | |
52 | * | + section2 | |
53 | * | + header2 = Second Header | |
54 | * | + sectionContent2 | |
55 | * | + paragraph = Second paragraph. | |
56 | * -------------------------------+-------------------------------------------- | |
57 | * | |
58 | * Examples C: - first section contains two sections of the second level | |
59 | * -------------------------------+-------------------------------------------- | |
60 | * Source | Result | |
61 | * -------------------------------+-------------------------------------------- | |
62 | * = First Header = |+ section0 | |
63 | * First paragraph. | + document | |
64 | * == Second Header == | + sectionContent0 | |
65 | * Second paragraph. | + section1 | |
66 | * == Third Header == | + header1 = First Header | |
67 | * Third paragraph | + sectionContent1 | |
68 | * | + paragraph = First paragraph. | |
69 | * | + section2 | |
70 | * | + header2 = Second Header | |
71 | * | + sectionContent2 | |
72 | * | + paragraph = Second paragraph. | |
73 | * | + section2 | |
74 | * | + header2 = Third Header | |
75 | * | + sectionContent2 | |
76 | * | + paragraph = Third paragraph. | |
77 | * -------------------------------+-------------------------------------------- | |
78 | * | |
79 | * Examples D: - Two sections of the first level | |
80 | * -------------------------------+-------------------------------------------- | |
81 | * Source | Result | |
82 | * -------------------------------+-------------------------------------------- | |
83 | * = First Header = |+ section0 | |
84 | * First paragraph. | + document | |
85 | * == Second Header == | + sectionContent0 | |
86 | * Second paragraph. | + section1 | |
87 | * == Third Header == | + header1 = First Header | |
88 | * Third paragraph | + sectionContent1 | |
89 | * = Fourth Header = | + paragraph = First paragraph. | |
90 | * Fourth paragr | + section2 | |
91 | * | + header2 = Second Header | |
92 | * | + sectionContent2 | |
93 | * | + paragraph = Second paragraph. | |
94 | * | + section2 | |
95 | * | + header2 = Third Header | |
96 | * | + sectionContent2 | |
97 | * | + paragraph = Third paragraph. | |
98 | * | + section1 | |
99 | * | + header1 = Fourth Header | |
100 | * | + sectionContent1 | |
101 | * | + paragraph = Fourth paragraph. | |
102 | * -------------------------------+-------------------------------------------- | |
103 | * </pre> | |
104 | * | |
105 | * @version $Id: 1996da09fd008e5466cd0f5fb9c742cf0061204f $ | |
106 | * @since 4.0M1 | |
107 | */ | |
108 | public interface IWemListenerDocument | |
109 | { | |
110 | /** | |
111 | * This method is called to notify about the beginning of the top-level parsed document or about the beginning of an | |
112 | * embedded document (contained in the main one). | |
113 | * | |
114 | * @param params the list of parameters for this event | |
115 | */ | |
116 | void beginDocument(WikiParameters params); | |
117 | ||
118 | /** | |
119 | * This method is called to notify about a new section header found in the document. | |
120 | * | |
121 | * @param headerLevel the level of the found header; valid values: 1-6 | |
122 | * @param params the list of parameters for this event | |
123 | */ | |
124 | void beginHeader(int headerLevel, WikiParameters params); | |
125 | ||
126 | /** | |
127 | * This method is used to notify about the beginning of a section. Document sections delimits a set of structural | |
128 | * elements at the same "level". A new level starts with a new document or a new header. | |
129 | * | |
130 | * @param docLevel the level (depth) of the document containing this section | |
131 | * @param headerLevel the level of the header defining this section | |
132 | * @param params the list of parameters for this event | |
133 | */ | |
134 | void beginSection(int docLevel, int headerLevel, WikiParameters params); | |
135 | ||
136 | /** | |
137 | * This method is used to notify about the beginning of a section. Document sections delimits a set of structural | |
138 | * elements at the same "level". A new level starts with a new document or a new header. | |
139 | * | |
140 | * @param docLevel the level (depth) of the document containing this section | |
141 | * @param headerLevel the level of the header defining this section | |
142 | * @param params the list of parameters for this event | |
143 | */ | |
144 | void beginSectionContent(int docLevel, int headerLevel, WikiParameters params); | |
145 | ||
146 | /** | |
147 | * This method is used to notify about the end of a top-level or an internal document. | |
148 | * | |
149 | * @param params the list of parameters for this event | |
150 | */ | |
151 | void endDocument(WikiParameters params); | |
152 | ||
153 | /** | |
154 | * This method is called to notify about the end of a section-level header. | |
155 | * | |
156 | * @param headerLevel the level of the header | |
157 | * @param params the list of parameters for this event | |
158 | */ | |
159 | void endHeader(int headerLevel, WikiParameters params); | |
160 | ||
161 | /** | |
162 | * This method is used to notify about the end of a document section. | |
163 | * | |
164 | * @param docLevel the level (depth) of the document containing this section | |
165 | * @param headerLevel the level of the header defining this section | |
166 | * @param params the list of parameters for this event | |
167 | */ | |
168 | void endSection(int docLevel, int headerLevel, WikiParameters params); | |
169 | ||
170 | /** | |
171 | * This method is used to notify about the end of a document section. | |
172 | * | |
173 | * @param docLevel the level (depth) of the document containing this section | |
174 | * @param headerLevel the level of the header defining this section | |
175 | * @param params the list of parameters for this event | |
176 | */ | |
177 | void endSectionContent(int docLevel, int headerLevel, WikiParameters params); | |
178 | } |