1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.rendering.wikimodel

File AgregatingWemListener.java

 

Coverage histogram

../../../../img/srcFileCovDistChart3.png
80% of files have more coverage

Code metrics

114
128
72
1
769
431
129
1.01
1.78
72
1.79

Classes

Class Line # Actions
AgregatingWemListener 26 128 0% 129 227
0.2770700827.7%
 

Contributing tests

This file is covered by 2 tests. .

Source view

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    * @version $Id: 9ebe3d0f99769976d6766e6fd2f0138e46bbeff9 $
24    * @since 4.0M1
25    */
 
26    public class AgregatingWemListener implements IWemListener
27    {
28    protected IWemListenerSimpleBlocks fBlockListener;
29   
30    protected IWemListenerDocument fDocumentListener;
31   
32    protected IWemListenerInline fInlineListener;
33   
34    protected IWemListenerList fListListener;
35   
36    protected IWemListenerProgramming fProgrammingListener;
37   
38    protected IWemListenerSemantic fSemanticListener;
39   
40    protected IWemListenerTable fTableListener;
41   
 
42  6 toggle public AgregatingWemListener()
43    {
44    // TODO Auto-generated constructor stub
45    }
46   
47    /**
48    * @see IWemListenerList#beginDefinitionDescription()
49    */
 
50  0 toggle public void beginDefinitionDescription()
51    {
52  0 if (fListListener != null) {
53  0 fListListener.beginDefinitionDescription();
54    }
55    }
56   
57    /**
58    * @see IWemListenerList#beginDefinitionList(WikiParameters)
59    */
 
60  0 toggle public void beginDefinitionList(WikiParameters params)
61    {
62  0 if (fListListener != null) {
63  0 fListListener.beginDefinitionList(params);
64    }
65    }
66   
67    /**
68    * @see IWemListenerList#beginDefinitionTerm()
69    */
 
70  0 toggle public void beginDefinitionTerm()
71    {
72  0 if (fListListener != null) {
73  0 fListListener.beginDefinitionTerm();
74    }
75    }
76   
77    /**
78    * @see IWemListenerDocument#beginDocument(WikiParameters)
79    */
 
80  6 toggle public void beginDocument(WikiParameters params)
81    {
82  6 if (fDocumentListener != null) {
83  6 fDocumentListener.beginDocument(params);
84    }
85    }
86   
87    /**
88    * @see IWemListenerInline#beginFormat(WikiFormat)
89    */
 
90  11 toggle public void beginFormat(WikiFormat format)
91    {
92  11 if (fInlineListener != null) {
93  11 fInlineListener.beginFormat(format);
94    }
95    }
96   
97    /**
98    * @see IWemListenerDocument#beginHeader(int,
99    * WikiParameters)
100    */
 
101  3 toggle public void beginHeader(int headerLevel, WikiParameters params)
102    {
103  3 if (fDocumentListener != null) {
104  3 fDocumentListener.beginHeader(headerLevel, params);
105    }
106    }
107   
108    /**
109    * @see IWemListenerSimpleBlocks#beginInfoBlock(java.lang.String,
110    * WikiParameters)
111    */
 
112  0 toggle public void beginInfoBlock(String infoType, WikiParameters params)
113    {
114  0 if (fBlockListener != null) {
115  0 fBlockListener.beginInfoBlock(infoType, params);
116    }
117    }
118   
119    /**
120    * @see IWemListenerList#beginList(WikiParameters,
121    * boolean)
122    */
 
123  3 toggle public void beginList(WikiParameters params, boolean ordered)
124    {
125  3 if (fListListener != null) {
126  3 fListListener.beginList(params, ordered);
127    }
128    }
129   
130    /**
131    * @see IWemListenerList#beginListItem()
132    */
 
133  5 toggle public void beginListItem()
134    {
135  5 if (fListListener != null) {
136  5 fListListener.beginListItem();
137    }
138    }
139   
140    /**
141    * @see IWemListenerSimpleBlocks#beginParagraph(WikiParameters)
142    */
 
143  2 toggle public void beginParagraph(WikiParameters params)
144    {
145  2 if (fBlockListener != null) {
146  2 fBlockListener.beginParagraph(params);
147    }
148    }
149   
150    /**
151    * @see IWemListenerSemantic#beginPropertyBlock(java.lang.String,
152    * boolean)
153    */
 
154  0 toggle public void beginPropertyBlock(String propertyUri, boolean doc)
155    {
156  0 if (fSemanticListener != null) {
157  0 fSemanticListener.beginPropertyBlock(propertyUri, doc);
158    }
159    }
160   
161    /**
162    * @see IWemListenerSemantic#beginPropertyInline(java.lang.String)
163    */
 
164  0 toggle public void beginPropertyInline(String propertyUri)
165    {
166  0 if (fSemanticListener != null) {
167  0 fSemanticListener.beginPropertyInline(propertyUri);
168    }
169    }
170   
171    /**
172    * @see IWemListenerList#beginQuotation(WikiParameters)
173    */
 
174  0 toggle public void beginQuotation(WikiParameters params)
175    {
176  0 if (fListListener != null) {
177  0 fListListener.beginQuotation(params);
178    }
179    }
180   
181    /**
182    * @see IWemListenerList#beginQuotationLine()
183    */
 
184  0 toggle public void beginQuotationLine()
185    {
186  0 if (fListListener != null) {
187  0 fListListener.beginQuotationLine();
188    }
189    }
190   
191    /**
192    * @see IWemListenerDocument#beginSection(int, int,
193    * WikiParameters)
194    */
 
195  9 toggle public void beginSection(
196    int docLevel,
197    int headerLevel,
198    WikiParameters params)
199    {
200  9 if (fDocumentListener != null) {
201  9 fDocumentListener.beginSection(docLevel, headerLevel, params);
202    }
203    }
204   
205    /**
206    * @see IWemListenerDocument#beginSectionContent(int, int,
207    * WikiParameters)
208    */
 
209  9 toggle public void beginSectionContent(
210    int docLevel,
211    int headerLevel,
212    WikiParameters params)
213    {
214  9 if (fDocumentListener != null) {
215  9 fDocumentListener.beginSectionContent(
216    docLevel,
217    headerLevel,
218    params);
219    }
220    }
221   
222    /**
223    * @see IWemListenerTable#beginTable(WikiParameters)
224    */
 
225  0 toggle public void beginTable(WikiParameters params)
226    {
227  0 if (fTableListener != null) {
228  0 fTableListener.beginTable(params);
229    }
230    }
231   
232    /**
233    * @see IWemListenerTable#beginTableCell(boolean,
234    * WikiParameters)
235    */
 
236  0 toggle public void beginTableCell(boolean tableHead, WikiParameters params)
237    {
238  0 if (fTableListener != null) {
239  0 fTableListener.beginTableCell(tableHead, params);
240    }
241    }
242   
243    /**
244    * @see IWemListenerTable#beginTableRow(WikiParameters)
245    */
 
246  0 toggle public void beginTableRow(WikiParameters params)
247    {
248  0 if (fTableListener != null) {
249  0 fTableListener.beginTableRow(params);
250    }
251    }
252   
253    /**
254    * @see IWemListenerList#endDefinitionDescription()
255    */
 
256  0 toggle public void endDefinitionDescription()
257    {
258  0 if (fListListener != null) {
259  0 fListListener.endDefinitionDescription();
260    }
261    }
262   
263    /**
264    * @see IWemListenerList#endDefinitionList(WikiParameters)
265    */
 
266  0 toggle public void endDefinitionList(WikiParameters params)
267    {
268  0 if (fListListener != null) {
269  0 fListListener.beginDefinitionList(params);
270    }
271    }
272   
273    /**
274    * @see IWemListenerList#endDefinitionTerm()
275    */
 
276  0 toggle public void endDefinitionTerm()
277    {
278  0 if (fListListener != null) {
279  0 fListListener.endDefinitionTerm();
280    }
281    }
282   
283    /**
284    * @see IWemListenerDocument#endDocument(WikiParameters)
285    */
 
286  6 toggle public void endDocument(WikiParameters params)
287    {
288  6 if (fDocumentListener != null) {
289  6 fDocumentListener.endDocument(params);
290    }
291    }
292   
293    /**
294    * @see IWemListenerInline#endFormat(WikiFormat)
295    */
 
296  11 toggle public void endFormat(WikiFormat format)
297    {
298  11 if (fInlineListener != null) {
299  11 fInlineListener.endFormat(format);
300    }
301    }
302   
303    /**
304    * @see IWemListenerDocument#endHeader(int,
305    * WikiParameters)
306    */
 
307  3 toggle public void endHeader(int headerLevel, WikiParameters params)
308    {
309  3 if (fDocumentListener != null) {
310  3 fDocumentListener.endHeader(headerLevel, params);
311    }
312    }
313   
314    /**
315    * @see IWemListenerSimpleBlocks#endInfoBlock(java.lang.String,
316    * WikiParameters)
317    */
 
318  0 toggle public void endInfoBlock(String infoType, WikiParameters params)
319    {
320  0 if (fBlockListener != null) {
321  0 fBlockListener.endInfoBlock(infoType, params);
322    }
323    }
324   
325    /**
326    * @see IWemListenerList#endList(WikiParameters,
327    * boolean)
328    */
 
329  3 toggle public void endList(WikiParameters params, boolean ordered)
330    {
331  3 if (fListListener != null) {
332  3 fListListener.endList(params, ordered);
333    }
334    }
335   
336    /**
337    * @see IWemListenerList#endListItem()
338    */
 
339  5 toggle public void endListItem()
340    {
341  5 if (fListListener != null) {
342  5 fListListener.endListItem();
343    }
344    }
345   
346    /**
347    * @see IWemListenerSimpleBlocks#endParagraph(WikiParameters)
348    */
 
349  2 toggle public void endParagraph(WikiParameters params)
350    {
351  2 if (fBlockListener != null) {
352  2 fBlockListener.endParagraph(params);
353    }
354    }
355   
356    /**
357    * @see IWemListenerSemantic#endPropertyBlock(java.lang.String,
358    * boolean)
359    */
 
360  0 toggle public void endPropertyBlock(String propertyUri, boolean doc)
361    {
362  0 if (fSemanticListener != null) {
363  0 fSemanticListener.endPropertyBlock(propertyUri, doc);
364    }
365    }
366   
367    /**
368    * @see IWemListenerSemantic#endPropertyInline(java.lang.String)
369    */
 
370  0 toggle public void endPropertyInline(String propertyUri)
371    {
372  0 if (fSemanticListener != null) {
373  0 fSemanticListener.endPropertyInline(propertyUri);
374    }
375    }
376   
377    /**
378    * @see IWemListenerList#endQuotation(WikiParameters)
379    */
 
380  0 toggle public void endQuotation(WikiParameters params)
381    {
382  0 if (fListListener != null) {
383  0 fListListener.endQuotation(params);
384    }
385    }
386   
387    /**
388    * @see IWemListenerList#endQuotationLine()
389    */
 
390  0 toggle public void endQuotationLine()
391    {
392  0 if (fListListener != null) {
393  0 fListListener.endQuotationLine();
394    }
395    }
396   
397    /**
398    * @see IWemListenerDocument#endSection(int, int,
399    * WikiParameters)
400    */
 
401  9 toggle public void endSection(int docLevel, int headerLevel, WikiParameters params)
402    {
403  9 if (fDocumentListener != null) {
404  9 fDocumentListener.endSection(docLevel, headerLevel, params);
405    }
406    }
407   
408    /**
409    * @see IWemListenerDocument#endSectionContent(int, int,
410    * WikiParameters)
411    */
 
412  9 toggle public void endSectionContent(
413    int docLevel,
414    int headerLevel,
415    WikiParameters params)
416    {
417  9 if (fDocumentListener != null) {
418  9 fDocumentListener.endSectionContent(docLevel, headerLevel, params);
419    }
420    }
421   
422    /**
423    * @see IWemListenerTable#endTable(WikiParameters)
424    */
 
425  0 toggle public void endTable(WikiParameters params)
426    {
427  0 if (fTableListener != null) {
428  0 fTableListener.endTable(params);
429    }
430    }
431   
432    /**
433    * @see IWemListenerTable#endTableCell(boolean,
434    * WikiParameters)
435    */
 
436  0 toggle public void endTableCell(boolean tableHead, WikiParameters params)
437    {
438  0 if (fTableListener != null) {
439  0 fTableListener.endTableCell(tableHead, params);
440    }
441    }
442   
443    /**
444    * @see IWemListenerTable#endTableRow(WikiParameters)
445    */
 
446  0 toggle public void endTableRow(WikiParameters params)
447    {
448  0 if (fTableListener != null) {
449  0 fTableListener.endTableRow(params);
450    }
451    }
452   
453    /**
454    * @return the blockListener
455    */
 
456  0 toggle public IWemListenerSimpleBlocks getBlockListener()
457    {
458  0 return fBlockListener;
459    }
460   
461    /**
462    * @return the documentListener
463    */
 
464  0 toggle public IWemListenerDocument getDocumentListener()
465    {
466  0 return fDocumentListener;
467    }
468   
469    /**
470    * @return the inlineListener
471    */
 
472  0 toggle public IWemListenerInline getInlineListener()
473    {
474  0 return fInlineListener;
475    }
476   
477    /**
478    * @return the listListener
479    */
 
480  0 toggle public IWemListenerList getListListener()
481    {
482  0 return fListListener;
483    }
484   
485    /**
486    * @return the programmingListener
487    */
 
488  0 toggle public IWemListenerProgramming getProgrammingListener()
489    {
490  0 return fProgrammingListener;
491    }
492   
493    /**
494    * @return the semanticListener
495    */
 
496  0 toggle public IWemListenerSemantic getSemanticListener()
497    {
498  0 return fSemanticListener;
499    }
500   
501    /**
502    * @return the tableListener
503    */
 
504  0 toggle public IWemListenerTable getTableListener()
505    {
506  0 return fTableListener;
507    }
508   
509    /**
510    * @see IWemListenerSimpleBlocks#onEmptyLines(int)
511    */
 
512  0 toggle public void onEmptyLines(int count)
513    {
514  0 if (fBlockListener != null) {
515  0 fBlockListener.onEmptyLines(count);
516    }
517    }
518   
519    /**
520    * @see IWemListenerInline#onEscape(java.lang.String)
521    */
 
522  0 toggle public void onEscape(String str)
523    {
524  0 if (fInlineListener != null) {
525  0 fInlineListener.onEscape(str);
526    }
527    }
528   
529    /**
530    * @see IWemListenerProgramming#onExtensionBlock(java.lang.String,
531    * WikiParameters)
532    */
 
533  0 toggle public void onExtensionBlock(String extensionName, WikiParameters params)
534    {
535  0 if (fProgrammingListener != null) {
536  0 fProgrammingListener.onExtensionBlock(extensionName, params);
537    }
538    }
539   
540    /**
541    * @see IWemListenerProgramming#onExtensionInline(java.lang.String,
542    * WikiParameters)
543    */
 
544  0 toggle public void onExtensionInline(String extensionName, WikiParameters params)
545    {
546  0 if (fProgrammingListener != null) {
547  0 fProgrammingListener.onExtensionInline(extensionName, params);
548    }
549    }
550   
551    /**
552    * @see IWemListenerSimpleBlocks#onHorizontalLine(WikiParameters)
553    */
 
554  0 toggle public void onHorizontalLine(WikiParameters params)
555    {
556  0 if (fBlockListener != null) {
557  0 fBlockListener.onHorizontalLine(params);
558    }
559    }
560   
561    /**
562    * @see IWemListenerInline#onImage(java.lang.String)
563    */
 
564  0 toggle public void onImage(String ref)
565    {
566  0 if (fInlineListener != null) {
567  0 fInlineListener.onImage(ref);
568    }
569    }
570   
571    /**
572    * @see IWemListenerInline#onImage(WikiReference)
573    */
 
574  0 toggle public void onImage(WikiReference ref)
575    {
576  0 if (fInlineListener != null) {
577  0 fInlineListener.onImage(ref);
578    }
579    }
580   
581    /**
582    * @see IWemListenerInline#onLineBreak()
583    */
 
584  0 toggle public void onLineBreak()
585    {
586  0 if (fInlineListener != null) {
587  0 fInlineListener.onLineBreak();
588    }
589    }
590   
591    /**
592    * @see IWemListenerProgramming#onMacroBlock(java.lang.String,
593    * WikiParameters, java.lang.String)
594    */
 
595  0 toggle public void onMacroBlock(
596    String macroName,
597    WikiParameters params,
598    String content)
599    {
600  0 if (fProgrammingListener != null) {
601  0 fProgrammingListener.onMacroBlock(macroName, params, content);
602    }
603    }
604   
605    /**
606    * @see IWemListenerProgramming#onMacroInline(java.lang.String,
607    * WikiParameters, java.lang.String)
608    */
 
609  0 toggle public void onMacroInline(
610    String macroName,
611    WikiParameters params,
612    String content)
613    {
614  0 if (fProgrammingListener != null) {
615  0 fProgrammingListener.onMacroInline(macroName, params, content);
616    }
617    }
618   
619    /* èèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèè */
620   
621    /**
622    * @see IWemListenerInline#onNewLine()
623    */
 
624  0 toggle public void onNewLine()
625    {
626  0 if (fInlineListener != null) {
627  0 fInlineListener.onNewLine();
628    }
629    }
630   
631    /**
632    * @see IWemListenerInline#onReference(java.lang.String)
633    */
 
634  0 toggle public void onReference(String ref)
635    {
636  0 if (fInlineListener != null) {
637  0 fInlineListener.onReference(ref);
638    }
639    }
640   
641    /**
642    * @see IWemListenerInline#onReference(WikiReference)
643    */
 
644  0 toggle public void onReference(WikiReference ref)
645    {
646  0 if (fInlineListener != null) {
647  0 fInlineListener.onReference(ref);
648    }
649    }
650   
651    /**
652    * @see IWemListenerInline#onSpace(java.lang.String)
653    */
 
654  5 toggle public void onSpace(String str)
655    {
656  5 if (fInlineListener != null) {
657  5 fInlineListener.onSpace(str);
658    }
659    }
660   
661    /**
662    * @see IWemListenerInline#onSpecialSymbol(java.lang.String)
663    */
 
664  0 toggle public void onSpecialSymbol(String str)
665    {
666  0 if (fInlineListener != null) {
667  0 fInlineListener.onSpecialSymbol(str);
668    }
669    }
670   
671    /**
672    * @see IWemListenerTable#onTableCaption(java.lang.String)
673    */
 
674  0 toggle public void onTableCaption(String str)
675    {
676  0 if (fTableListener != null) {
677  0 fTableListener.onTableCaption(str);
678    }
679    }
680   
681    /**
682    * @see IWemListenerSimpleBlocks#onVerbatimBlock(java.lang.String,
683    * WikiParameters)
684    */
 
685  0 toggle public void onVerbatimBlock(String str, WikiParameters params)
686    {
687  0 if (fBlockListener != null) {
688  0 fBlockListener.onVerbatimBlock(str, params);
689    }
690    }
691   
692    /**
693    * @see IWemListenerInline#onVerbatimInline(java.lang.String,
694    * WikiParameters)
695    */
 
696  0 toggle public void onVerbatimInline(String str, WikiParameters params)
697    {
698  0 if (fInlineListener != null) {
699  0 fInlineListener.onVerbatimInline(str, params);
700    }
701    }
702   
703    /**
704    * @see IWemListenerInline#onWord(java.lang.String)
705    */
 
706  15 toggle public void onWord(String str)
707    {
708  15 if (fInlineListener != null) {
709  15 fInlineListener.onWord(str);
710    }
711    }
712   
713    /**
714    * @param blockListener the blockListener to set
715    */
 
716  6 toggle public void setBlockListener(IWemListenerSimpleBlocks blockListener)
717    {
718  6 fBlockListener = blockListener;
719    }
720   
721    /**
722    * @param documentListener the documentListener to set
723    */
 
724  6 toggle public void setDocumentListener(IWemListenerDocument documentListener)
725    {
726  6 fDocumentListener = documentListener;
727    }
728   
729    /**
730    * @param inlineListener the inlineListener to set
731    */
 
732  6 toggle public void setInlineListener(IWemListenerInline inlineListener)
733    {
734  6 fInlineListener = inlineListener;
735    }
736   
737    /**
738    * @param listListener the listListener to set
739    */
 
740  6 toggle public void setListListener(IWemListenerList listListener)
741    {
742  6 fListListener = listListener;
743    }
744   
745    /**
746    * @param programmingListener the programmingListener to set
747    */
 
748  6 toggle public void setProgrammingListener(
749    IWemListenerProgramming programmingListener)
750    {
751  6 fProgrammingListener = programmingListener;
752    }
753   
754    /**
755    * @param semanticListener the semanticListener to set
756    */
 
757  6 toggle public void setSemanticListener(IWemListenerSemantic semanticListener)
758    {
759  6 fSemanticListener = semanticListener;
760    }
761   
762    /**
763    * @param tableListener the tableListener to set
764    */
 
765  6 toggle public void setTableListener(IWemListenerTable tableListener)
766    {
767  6 fTableListener = tableListener;
768    }
769    }