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; |
21 |
|
|
22 |
|
|
23 |
|
@version |
24 |
|
@since |
25 |
|
|
|
|
| 43.8% |
Uncovered Elements: 68 (121) |
Complexity: 70 |
Complexity Density: 1.43 |
|
26 |
|
public class PrintTextListener implements IWemListener |
27 |
|
{ |
28 |
|
private final IWikiPrinter fPrinter; |
29 |
|
|
30 |
|
protected ReferenceHandler fRefHandler; |
31 |
|
|
32 |
|
private boolean supportImage; |
33 |
|
|
34 |
|
private boolean supportDownload; |
35 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
36 |
17 |
public PrintTextListener(IWikiPrinter printer)... |
37 |
|
{ |
38 |
17 |
this(printer, false, false); |
39 |
|
} |
40 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
41 |
1354 |
public PrintTextListener(IWikiPrinter printer, boolean supportImage, boolean supportDownload)... |
42 |
|
{ |
43 |
1354 |
this.supportImage = supportImage; |
44 |
1354 |
this.supportDownload = supportDownload; |
45 |
|
|
46 |
1354 |
fPrinter = printer; |
47 |
1354 |
fRefHandler = newReferenceHandler(); |
48 |
|
} |
49 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
50 |
1341 |
public boolean isSupportImage()... |
51 |
|
{ |
52 |
1341 |
return supportImage; |
53 |
|
} |
54 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
55 |
1341 |
public boolean isSupportDownload()... |
56 |
|
{ |
57 |
1341 |
return supportDownload; |
58 |
|
} |
59 |
|
|
60 |
|
|
61 |
|
@see |
62 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
63 |
0 |
public void beginDefinitionDescription()... |
64 |
|
{ |
65 |
|
} |
66 |
|
|
67 |
|
|
68 |
|
@see |
69 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
70 |
0 |
public void beginDefinitionList(WikiParameters params)... |
71 |
|
{ |
72 |
|
} |
73 |
|
|
74 |
|
|
75 |
|
@see |
76 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
77 |
0 |
public void beginDefinitionTerm()... |
78 |
|
{ |
79 |
|
} |
80 |
|
|
81 |
|
|
82 |
|
@see |
83 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
84 |
0 |
public void beginDocument(WikiParameters params)... |
85 |
|
{ |
86 |
|
} |
87 |
|
|
88 |
|
|
89 |
|
@see |
90 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
91 |
0 |
public void beginFormat(WikiFormat format)... |
92 |
|
{ |
93 |
|
} |
94 |
|
|
95 |
|
|
96 |
|
@see |
97 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
98 |
0 |
public void beginHeader(int headerLevel, WikiParameters params)... |
99 |
|
{ |
100 |
|
} |
101 |
|
|
102 |
|
|
103 |
|
@see |
104 |
|
|
105 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
106 |
0 |
public void beginInfoBlock(String infoType, WikiParameters params)... |
107 |
|
{ |
108 |
|
|
109 |
|
} |
110 |
|
|
111 |
|
|
112 |
|
@see |
113 |
|
|
114 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
115 |
0 |
public void beginList(WikiParameters params, boolean ordered)... |
116 |
|
{ |
117 |
|
} |
118 |
|
|
119 |
|
|
120 |
|
@see |
121 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
122 |
0 |
public void beginListItem()... |
123 |
|
{ |
124 |
|
} |
125 |
|
|
126 |
|
|
127 |
|
@see |
128 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
129 |
0 |
public void beginParagraph(WikiParameters params)... |
130 |
|
{ |
131 |
|
} |
132 |
|
|
133 |
|
|
134 |
|
@see |
135 |
|
|
136 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
137 |
0 |
public void beginPropertyBlock(String propertyUri, boolean doc)... |
138 |
|
{ |
139 |
|
} |
140 |
|
|
141 |
|
|
142 |
|
@see |
143 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
144 |
0 |
public void beginPropertyInline(String str)... |
145 |
|
{ |
146 |
|
} |
147 |
|
|
148 |
|
|
149 |
|
@see |
150 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
151 |
0 |
public void beginQuotation(WikiParameters params)... |
152 |
|
{ |
153 |
|
} |
154 |
|
|
155 |
|
|
156 |
|
@see |
157 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
158 |
0 |
public void beginQuotationLine()... |
159 |
|
{ |
160 |
|
|
161 |
|
} |
162 |
|
|
163 |
|
|
164 |
|
@see |
165 |
|
|
166 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
167 |
1741 |
public void beginSection(... |
168 |
|
int docLevel, |
169 |
|
int headerLevel, |
170 |
|
WikiParameters params) |
171 |
|
{ |
172 |
|
|
173 |
|
} |
174 |
|
|
175 |
|
|
176 |
|
@see |
177 |
|
|
178 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
179 |
1729 |
public void beginSectionContent(... |
180 |
|
int docLevel, |
181 |
|
int headerLevel, |
182 |
|
WikiParameters params) |
183 |
|
{ |
184 |
|
|
185 |
|
} |
186 |
|
|
187 |
|
|
188 |
|
@see |
189 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
190 |
0 |
public void beginTable(WikiParameters params)... |
191 |
|
{ |
192 |
|
} |
193 |
|
|
194 |
|
|
195 |
|
@see |
196 |
|
|
197 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
198 |
0 |
public void beginTableCell(boolean tableHead, WikiParameters params)... |
199 |
|
{ |
200 |
|
} |
201 |
|
|
202 |
|
|
203 |
|
@see |
204 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
205 |
0 |
public void beginTableRow(WikiParameters params)... |
206 |
|
{ |
207 |
|
} |
208 |
|
|
209 |
|
|
210 |
|
|
211 |
|
|
212 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
213 |
0 |
protected void endBlock()... |
214 |
|
{ |
215 |
|
|
216 |
|
} |
217 |
|
|
218 |
|
|
219 |
|
@see |
220 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
221 |
0 |
public void endDefinitionDescription()... |
222 |
|
{ |
223 |
0 |
endBlock(); |
224 |
|
} |
225 |
|
|
226 |
|
|
227 |
|
@see |
228 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
229 |
0 |
public void endDefinitionList(WikiParameters params)... |
230 |
|
{ |
231 |
0 |
endBlock(); |
232 |
|
} |
233 |
|
|
234 |
|
|
235 |
|
@see |
236 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
237 |
0 |
public void endDefinitionTerm()... |
238 |
|
{ |
239 |
|
} |
240 |
|
|
241 |
|
|
242 |
|
@see |
243 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
244 |
0 |
public void endDocument(WikiParameters params)... |
245 |
|
{ |
246 |
0 |
endBlock(); |
247 |
|
} |
248 |
|
|
249 |
|
|
250 |
|
@see |
251 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
252 |
0 |
public void endFormat(WikiFormat format)... |
253 |
|
{ |
254 |
|
} |
255 |
|
|
256 |
|
|
257 |
|
@see |
258 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
259 |
0 |
public void endHeader(int headerLevel, WikiParameters params)... |
260 |
|
{ |
261 |
0 |
endBlock(); |
262 |
|
} |
263 |
|
|
264 |
|
|
265 |
|
@see |
266 |
|
|
267 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
268 |
0 |
public void endInfoBlock(String infoType, WikiParameters params)... |
269 |
|
{ |
270 |
0 |
endBlock(); |
271 |
|
} |
272 |
|
|
273 |
|
|
274 |
|
@see |
275 |
|
|
276 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
277 |
0 |
public void endList(WikiParameters params, boolean ordered)... |
278 |
|
{ |
279 |
0 |
endBlock(); |
280 |
|
} |
281 |
|
|
282 |
|
|
283 |
|
@see |
284 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
285 |
0 |
public void endListItem()... |
286 |
|
{ |
287 |
0 |
endBlock(); |
288 |
|
} |
289 |
|
|
290 |
|
|
291 |
|
@see |
292 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
293 |
0 |
public void endParagraph(WikiParameters params)... |
294 |
|
{ |
295 |
0 |
endBlock(); |
296 |
|
} |
297 |
|
|
298 |
|
|
299 |
|
@see |
300 |
|
|
301 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
302 |
0 |
public void endPropertyBlock(String propertyUri, boolean doc)... |
303 |
|
{ |
304 |
0 |
endBlock(); |
305 |
|
} |
306 |
|
|
307 |
|
|
308 |
|
@see |
309 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
310 |
0 |
public void endPropertyInline(String inlineProperty)... |
311 |
|
{ |
312 |
|
} |
313 |
|
|
314 |
|
|
315 |
|
@see |
316 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
317 |
0 |
public void endQuotation(WikiParameters params)... |
318 |
|
{ |
319 |
0 |
endBlock(); |
320 |
|
} |
321 |
|
|
322 |
|
|
323 |
|
@see |
324 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
325 |
0 |
public void endQuotationLine()... |
326 |
|
{ |
327 |
|
|
328 |
|
} |
329 |
|
|
330 |
|
|
331 |
|
@see |
332 |
|
|
333 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
334 |
1741 |
public void endSection(int docLevel, int headerLevel, WikiParameters params)... |
335 |
|
{ |
336 |
|
|
337 |
|
} |
338 |
|
|
339 |
|
|
340 |
|
@see |
341 |
|
|
342 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
343 |
1729 |
public void endSectionContent(... |
344 |
|
int docLevel, |
345 |
|
int headerLevel, |
346 |
|
WikiParameters params) |
347 |
|
{ |
348 |
|
|
349 |
|
} |
350 |
|
|
351 |
|
|
352 |
|
@see |
353 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
354 |
0 |
public void endTable(WikiParameters params)... |
355 |
|
{ |
356 |
0 |
endBlock(); |
357 |
|
} |
358 |
|
|
359 |
|
|
360 |
|
@see |
361 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
362 |
0 |
public void endTableCell(boolean tableHead, WikiParameters params)... |
363 |
|
{ |
364 |
|
} |
365 |
|
|
366 |
|
|
367 |
|
@see |
368 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
369 |
0 |
public void endTableRow(WikiParameters params)... |
370 |
|
{ |
371 |
|
} |
372 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
373 |
1 |
protected ReferenceHandler newReferenceHandler()... |
374 |
|
{ |
375 |
1 |
return new ReferenceHandler(supportImage, supportDownload) |
376 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
377 |
0 |
@Override... |
378 |
|
protected void handleImage( |
379 |
|
String ref, |
380 |
|
String label, |
381 |
|
WikiParameters params) |
382 |
|
{ |
383 |
0 |
handleReference(ref, label, params); |
384 |
|
} |
385 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
386 |
1 |
@Override... |
387 |
|
protected void handleReference( |
388 |
|
String ref, |
389 |
|
String label, |
390 |
|
WikiParameters params) |
391 |
|
{ |
392 |
1 |
print(label); |
393 |
1 |
print("<" + ref + ">"); |
394 |
|
} |
395 |
|
}; |
396 |
|
} |
397 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
398 |
0 |
public void onEmptyLines(int count)... |
399 |
|
{ |
400 |
|
|
401 |
|
} |
402 |
|
|
403 |
|
|
404 |
|
@see |
405 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
406 |
0 |
public void onEscape(String str)... |
407 |
|
{ |
408 |
0 |
print(str); |
409 |
|
} |
410 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
411 |
0 |
public void onExtensionBlock(String extensionName, WikiParameters params)... |
412 |
|
{ |
413 |
|
|
414 |
|
} |
415 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
416 |
0 |
public void onExtensionInline(String extensionName, WikiParameters params)... |
417 |
|
{ |
418 |
|
} |
419 |
|
|
420 |
|
|
421 |
|
@see |
422 |
|
|
423 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
424 |
0 |
public void onHorizontalLine(WikiParameters params)... |
425 |
|
{ |
426 |
|
} |
427 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
428 |
11 |
public void onImage(String ref)... |
429 |
|
{ |
430 |
11 |
print("<img"); |
431 |
11 |
print(" src='" + ref + "'"); |
432 |
11 |
print(" class='wikimodel-freestanding'/>"); |
433 |
|
} |
434 |
|
|
|
|
| 92.9% |
Uncovered Elements: 1 (14) |
Complexity: 3 |
Complexity Density: 0.3 |
|
435 |
10 |
public void onImage(WikiReference ref)... |
436 |
|
{ |
437 |
10 |
print("<img"); |
438 |
10 |
String link = ref.getLink(); |
439 |
10 |
link = WikiPageUtil.escapeXmlAttribute(link); |
440 |
10 |
print(" src='" + link + "'"); |
441 |
10 |
WikiParameters params = ref.getParameters(); |
442 |
10 |
String label = ref.getLabel(); |
443 |
10 |
if (label != null) { |
444 |
4 |
if (params.getParameter("title") == null) { |
445 |
4 |
params = params.addParameter("title", label); |
446 |
|
} |
447 |
|
} |
448 |
10 |
print(params + "/>"); |
449 |
|
} |
450 |
|
|
451 |
|
|
452 |
|
@see |
453 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
454 |
0 |
public void onLineBreak()... |
455 |
|
{ |
456 |
0 |
println(""); |
457 |
|
} |
458 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
459 |
0 |
public void onMacroBlock(... |
460 |
|
String macroName, |
461 |
|
WikiParameters params, |
462 |
|
String content) |
463 |
|
{ |
464 |
|
} |
465 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
466 |
0 |
public void onMacroInline(... |
467 |
|
String macroName, |
468 |
|
WikiParameters params, |
469 |
|
String content) |
470 |
|
{ |
471 |
|
} |
472 |
|
|
473 |
|
|
474 |
|
@see |
475 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
476 |
169 |
public void onNewLine()... |
477 |
|
{ |
478 |
169 |
println(""); |
479 |
|
} |
480 |
|
|
481 |
|
|
482 |
|
@see |
483 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
484 |
39 |
public void onReference(String ref)... |
485 |
|
{ |
486 |
39 |
WikiReference reference = new WikiReference(ref); |
487 |
39 |
onReference(reference); |
488 |
|
} |
489 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
490 |
127 |
public void onReference(WikiReference ref)... |
491 |
|
{ |
492 |
127 |
fRefHandler.handle(ref); |
493 |
|
} |
494 |
|
|
495 |
|
|
496 |
|
@see |
497 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
498 |
1948 |
public void onSpace(String str)... |
499 |
|
{ |
500 |
1948 |
print(str); |
501 |
|
} |
502 |
|
|
503 |
|
|
504 |
|
@see |
505 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
506 |
0 |
public void onSpecialSymbol(String str)... |
507 |
|
{ |
508 |
0 |
print(str); |
509 |
|
} |
510 |
|
|
511 |
|
|
512 |
|
@see |
513 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
514 |
0 |
public void onTableCaption(String str)... |
515 |
|
{ |
516 |
|
} |
517 |
|
|
518 |
|
|
519 |
|
@see |
520 |
|
|
521 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
522 |
0 |
public void onVerbatimBlock(String str, WikiParameters params)... |
523 |
|
{ |
524 |
0 |
print(str); |
525 |
|
} |
526 |
|
|
527 |
|
|
528 |
|
@see |
529 |
|
|
530 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
531 |
0 |
public void onVerbatimInline(String str, WikiParameters params)... |
532 |
|
{ |
533 |
0 |
print(str); |
534 |
|
} |
535 |
|
|
536 |
|
|
537 |
|
@see |
538 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
539 |
3341 |
public void onWord(String str)... |
540 |
|
{ |
541 |
3341 |
print(str); |
542 |
|
} |
543 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
544 |
13078 |
protected void print(String str)... |
545 |
|
{ |
546 |
13078 |
fPrinter.print(str); |
547 |
|
} |
548 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
549 |
0 |
protected void println()... |
550 |
|
{ |
551 |
0 |
fPrinter.println(""); |
552 |
|
} |
553 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
554 |
6096 |
protected void println(String str)... |
555 |
|
{ |
556 |
6096 |
fPrinter.println(str); |
557 |
|
} |
558 |
|
} |