1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.rendering.wikimodel.jspwiki; |
21 |
|
|
22 |
|
import org.xwiki.rendering.wikimodel.IWemListener; |
23 |
|
import org.xwiki.rendering.wikimodel.WikiFormat; |
24 |
|
import org.xwiki.rendering.wikimodel.WikiParameters; |
25 |
|
import org.xwiki.rendering.wikimodel.WikiReference; |
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
@version |
31 |
|
@since |
32 |
|
|
|
|
| 0% |
Uncovered Elements: 124 (124) |
Complexity: 73 |
Complexity Density: 1.66 |
|
33 |
|
public class JspWikiSerializer implements IWemListener |
34 |
|
{ |
35 |
|
private StringBuffer fBuffer; |
36 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
37 |
0 |
public JspWikiSerializer()... |
38 |
|
{ |
39 |
|
|
40 |
|
} |
41 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
42 |
0 |
public JspWikiSerializer(StringBuffer buf)... |
43 |
|
{ |
44 |
0 |
fBuffer = buf; |
45 |
|
} |
46 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
47 |
0 |
public void beginDefinitionDescription()... |
48 |
|
{ |
49 |
|
|
50 |
|
|
51 |
|
} |
52 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
53 |
0 |
public void beginDefinitionList(WikiParameters params)... |
54 |
|
{ |
55 |
|
|
56 |
|
|
57 |
|
} |
58 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
59 |
0 |
public void beginDefinitionTerm()... |
60 |
|
{ |
61 |
|
|
62 |
|
|
63 |
|
} |
64 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
65 |
0 |
public void beginDocument()... |
66 |
|
{ |
67 |
|
|
68 |
|
|
69 |
|
} |
70 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
71 |
0 |
public void beginDocument(WikiParameters params)... |
72 |
|
{ |
73 |
|
|
74 |
|
|
75 |
|
} |
76 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
77 |
0 |
public void beginFormat(WikiFormat format)... |
78 |
|
{ |
79 |
|
|
80 |
|
|
81 |
|
} |
82 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
83 |
0 |
public void beginHeader(int headerLevel, WikiParameters params)... |
84 |
|
{ |
85 |
0 |
println(getEol()); |
86 |
0 |
for (int i = 0; i < headerLevel; i++) { |
87 |
0 |
print("!"); |
88 |
|
} |
89 |
0 |
print(" "); |
90 |
|
} |
91 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
92 |
0 |
public void beginInfoBlock(String infoType, WikiParameters params)... |
93 |
|
{ |
94 |
|
|
95 |
|
|
96 |
|
} |
97 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
98 |
0 |
public void beginList(WikiParameters params, boolean ordered)... |
99 |
|
{ |
100 |
|
|
101 |
|
|
102 |
|
} |
103 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
104 |
0 |
public void beginListItem()... |
105 |
|
{ |
106 |
0 |
print("* "); |
107 |
|
} |
108 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
109 |
0 |
public void beginParagraph(WikiParameters params)... |
110 |
|
{ |
111 |
|
|
112 |
|
|
113 |
|
} |
114 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
115 |
0 |
public void beginPropertyBlock(String propertyUri, boolean doc)... |
116 |
|
{ |
117 |
|
|
118 |
|
|
119 |
|
} |
120 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
121 |
0 |
public void beginPropertyInline(String str)... |
122 |
|
{ |
123 |
|
|
124 |
|
|
125 |
|
} |
126 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
127 |
0 |
public void beginQuotation(WikiParameters params)... |
128 |
|
{ |
129 |
|
|
130 |
|
|
131 |
|
} |
132 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
133 |
0 |
public void beginQuotationLine()... |
134 |
|
{ |
135 |
|
|
136 |
|
|
137 |
|
} |
138 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
139 |
0 |
public void beginSection(... |
140 |
|
int docLevel, |
141 |
|
int headerLevel, |
142 |
|
WikiParameters params) |
143 |
|
{ |
144 |
|
|
145 |
|
|
146 |
|
} |
147 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
148 |
0 |
public void beginSectionContent(... |
149 |
|
int docLevel, |
150 |
|
int headerLevel, |
151 |
|
WikiParameters params) |
152 |
|
{ |
153 |
|
|
154 |
|
|
155 |
|
} |
156 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
157 |
0 |
public void beginTable(WikiParameters params)... |
158 |
|
{ |
159 |
|
} |
160 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
161 |
0 |
public void beginTableCell(boolean tableHead, WikiParameters params)... |
162 |
|
{ |
163 |
0 |
if (tableHead) { |
164 |
0 |
print("||"); |
165 |
|
} else { |
166 |
0 |
print("|"); |
167 |
|
} |
168 |
|
} |
169 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
170 |
0 |
public void beginTableRow(WikiParameters params)... |
171 |
|
{ |
172 |
0 |
println(""); |
173 |
|
} |
174 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
175 |
0 |
public void endDefinitionDescription()... |
176 |
|
{ |
177 |
|
|
178 |
|
|
179 |
|
} |
180 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
181 |
0 |
public void endDefinitionList(WikiParameters params)... |
182 |
|
{ |
183 |
|
|
184 |
|
|
185 |
|
} |
186 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
187 |
0 |
public void endDefinitionTerm()... |
188 |
|
{ |
189 |
|
|
190 |
|
|
191 |
|
} |
192 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
193 |
0 |
public void endDocument()... |
194 |
|
{ |
195 |
|
|
196 |
|
|
197 |
|
} |
198 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
199 |
0 |
public void endDocument(WikiParameters params)... |
200 |
|
{ |
201 |
|
|
202 |
|
|
203 |
|
} |
204 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
205 |
0 |
public void endFormat(WikiFormat format)... |
206 |
|
{ |
207 |
|
|
208 |
|
|
209 |
|
} |
210 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
211 |
0 |
public void endHeader(int headerLevel, WikiParameters params)... |
212 |
|
{ |
213 |
0 |
println(""); |
214 |
0 |
println(""); |
215 |
|
} |
216 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
217 |
0 |
public void endInfoBlock(String infoType, WikiParameters params)... |
218 |
|
{ |
219 |
|
|
220 |
|
|
221 |
|
} |
222 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
223 |
0 |
public void endList(WikiParameters params, boolean ordered)... |
224 |
|
{ |
225 |
|
|
226 |
|
|
227 |
|
} |
228 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
229 |
0 |
public void endListItem()... |
230 |
|
{ |
231 |
0 |
println(""); |
232 |
|
} |
233 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
234 |
0 |
public void endParagraph(WikiParameters params)... |
235 |
|
{ |
236 |
|
|
237 |
|
|
238 |
|
} |
239 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
240 |
0 |
public void endPropertyBlock(String propertyUri, boolean doc)... |
241 |
|
{ |
242 |
|
|
243 |
|
|
244 |
|
} |
245 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
246 |
0 |
public void endPropertyInline(String inlineProperty)... |
247 |
|
{ |
248 |
|
|
249 |
|
|
250 |
|
} |
251 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
252 |
0 |
public void endQuotation(WikiParameters params)... |
253 |
|
{ |
254 |
|
|
255 |
|
|
256 |
|
} |
257 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
258 |
0 |
public void endQuotationLine()... |
259 |
|
{ |
260 |
|
|
261 |
|
|
262 |
|
} |
263 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
264 |
0 |
public void endSection(int docLevel, int headerLevel, WikiParameters params)... |
265 |
|
{ |
266 |
|
|
267 |
|
|
268 |
|
} |
269 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
270 |
0 |
public void endSectionContent(... |
271 |
|
int docLevel, |
272 |
|
int headerLevel, |
273 |
|
WikiParameters params) |
274 |
|
{ |
275 |
|
|
276 |
|
|
277 |
|
} |
278 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
279 |
0 |
public void endTable(WikiParameters params)... |
280 |
|
{ |
281 |
|
} |
282 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
283 |
0 |
public void endTableCell(boolean tableHead, WikiParameters params)... |
284 |
|
{ |
285 |
0 |
if (tableHead) { |
286 |
0 |
print("||"); |
287 |
|
} else { |
288 |
0 |
print("|"); |
289 |
|
} |
290 |
|
} |
291 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
292 |
0 |
public void endTableRow(WikiParameters params)... |
293 |
|
{ |
294 |
0 |
println(""); |
295 |
|
} |
296 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
297 |
0 |
protected String getEol()... |
298 |
|
{ |
299 |
0 |
return "\n"; |
300 |
|
} |
301 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
302 |
0 |
public void onEmptyLines(int count)... |
303 |
|
{ |
304 |
|
|
305 |
|
|
306 |
|
} |
307 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
308 |
0 |
public void onEscape(String str)... |
309 |
|
{ |
310 |
|
|
311 |
|
|
312 |
|
} |
313 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
314 |
0 |
public void onExtensionBlock(String extensionName, WikiParameters params)... |
315 |
|
{ |
316 |
|
|
317 |
|
|
318 |
|
} |
319 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
320 |
0 |
public void onExtensionInline(String extensionName, WikiParameters params)... |
321 |
|
{ |
322 |
|
|
323 |
|
|
324 |
|
} |
325 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
326 |
0 |
public void onHorizontalLine(WikiParameters params)... |
327 |
|
{ |
328 |
0 |
println("----"); |
329 |
|
} |
330 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
331 |
0 |
public void onImage(String ref)... |
332 |
|
{ |
333 |
|
|
334 |
|
|
335 |
|
} |
336 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
337 |
0 |
public void onImage(WikiReference ref)... |
338 |
|
{ |
339 |
|
|
340 |
|
|
341 |
|
} |
342 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
343 |
0 |
public void onLineBreak()... |
344 |
|
{ |
345 |
0 |
println(""); |
346 |
0 |
println(""); |
347 |
|
} |
348 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
349 |
0 |
public void onMacro(String macroName, WikiParameters params, String content)... |
350 |
|
{ |
351 |
|
|
352 |
|
|
353 |
|
} |
354 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
355 |
0 |
public void onMacroBlock(... |
356 |
|
String macroName, |
357 |
|
WikiParameters params, |
358 |
|
String content) |
359 |
|
{ |
360 |
|
|
361 |
|
|
362 |
|
} |
363 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
364 |
0 |
public void onMacroInline(... |
365 |
|
String macroName, |
366 |
|
WikiParameters params, |
367 |
|
String content) |
368 |
|
{ |
369 |
|
|
370 |
|
|
371 |
|
} |
372 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
373 |
0 |
public void onNewLine()... |
374 |
|
{ |
375 |
0 |
println(""); |
376 |
|
} |
377 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
378 |
0 |
public void onReference(String ref)... |
379 |
|
{ |
380 |
0 |
onReference(ref, null); |
381 |
|
} |
382 |
|
|
|
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 3 |
Complexity Density: 0.5 |
|
383 |
0 |
private void onReference(String link, String label)... |
384 |
|
{ |
385 |
0 |
link = link.replaceAll(" ", "_"); |
386 |
0 |
if (link.indexOf("Image") == 0) { |
387 |
0 |
print("{image" + link.substring(5) + "}"); |
388 |
|
} else { |
389 |
0 |
if (label != null) { |
390 |
0 |
print("[" + label + ">" + link + "]"); |
391 |
|
} else { |
392 |
0 |
print("[" + link + "]"); |
393 |
|
} |
394 |
|
} |
395 |
|
} |
396 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
397 |
0 |
public void onReference(WikiReference ref)... |
398 |
|
{ |
399 |
0 |
onReference(ref.getLink(), ref.getLabel()); |
400 |
|
} |
401 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
402 |
0 |
public void onSpace(String str)... |
403 |
|
{ |
404 |
0 |
print(str); |
405 |
|
} |
406 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
407 |
0 |
public void onSpecialSymbol(String str)... |
408 |
|
{ |
409 |
0 |
print(str); |
410 |
|
} |
411 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
412 |
0 |
public void onTableCaption(String str)... |
413 |
|
{ |
414 |
0 |
println(str); |
415 |
|
} |
416 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
417 |
0 |
public void onVerbatimBlock(String str, WikiParameters params)... |
418 |
|
{ |
419 |
0 |
print("{{{" + str + "}}}"); |
420 |
|
} |
421 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
422 |
0 |
public void onVerbatimInline(String str, WikiParameters params)... |
423 |
|
{ |
424 |
0 |
println("{{{" + str + "}}}"); |
425 |
|
} |
426 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
427 |
0 |
public void onWord(String str)... |
428 |
|
{ |
429 |
0 |
print(str); |
430 |
|
} |
431 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
432 |
0 |
protected void print(String str)... |
433 |
|
{ |
434 |
0 |
if (fBuffer != null) { |
435 |
0 |
fBuffer.append(str); |
436 |
|
} else { |
437 |
0 |
System.out.print(str); |
438 |
|
} |
439 |
|
} |
440 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
441 |
0 |
protected void println(String str)... |
442 |
|
{ |
443 |
0 |
if (fBuffer != null) { |
444 |
0 |
fBuffer.append(str); |
445 |
0 |
String eol = getEol(); |
446 |
0 |
fBuffer.append(eol); |
447 |
|
} else { |
448 |
0 |
System.out.println(str); |
449 |
|
} |
450 |
|
} |
451 |
|
} |