Clover Coverage Report - XWiki Rendering - Parent POM 4.0-SNAPSHOT (Aggregated)
Coverage timestamp: Mon Mar 12 2012 18:03:13 CET
../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
63   645   63   1
0   438   1   63
63     1  
1    
 
  EventType       Line # 38 63 0% 63 10 92.1% 0.9206349
 
  (389)
 
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.listener.chaining;
21   
22    import java.util.Map;
23   
24    import org.xwiki.rendering.listener.Format;
25    import org.xwiki.rendering.listener.HeaderLevel;
26    import org.xwiki.rendering.listener.MetaData;
27    import org.xwiki.rendering.listener.reference.ResourceReference;
28    import org.xwiki.rendering.listener.ListType;
29    import org.xwiki.rendering.listener.Listener;
30    import org.xwiki.rendering.syntax.Syntax;
31   
32    /**
33    * Stores event types and offers a way to call a stored event.
34    *
35    * @version $Id: 2b448a12972a2b13320b0329d2e9d0d591a07da6 $
36    * @since 1.8RC1
37    */
 
38    public enum EventType
39    {
40    /**
41    * @see Listener#beginDocument(org.xwiki.rendering.listener.MetaData)
42    */
43    BEGIN_DOCUMENT {
 
44  399 toggle @Override
45    public void fireEvent(Listener listener, Object[] eventParameters)
46    {
47  399 listener.beginDocument((MetaData) eventParameters[0]);
48    }
49    },
50    /**
51    * @see Listener#endDocument(org.xwiki.rendering.listener.MetaData)
52    */
53    END_DOCUMENT {
 
54  399 toggle @Override
55    public void fireEvent(Listener listener, Object[] eventParameters)
56    {
57  399 listener.endDocument((MetaData) eventParameters[0]);
58    }
59    },
60    /**
61    * @see Listener#beginGroup(java.util.Map)
62    */
63    BEGIN_GROUP {
 
64  33 toggle @Override
65    public void fireEvent(Listener listener, Object[] eventParameters)
66    {
67  33 listener.beginGroup((Map<String, String>) eventParameters[0]);
68    }
69    },
70    /**
71    * @see Listener#endGroup(java.util.Map)
72    */
73    END_GROUP {
 
74  33 toggle @Override
75    public void fireEvent(Listener listener, Object[] eventParameters)
76    {
77  33 listener.endGroup((Map<String, String>) eventParameters[0]);
78    }
79   
 
80  0 toggle @Override
81    public boolean isInlineEnd()
82    {
83  0 return true;
84    }
85    },
86    /**
87    * @see Listener#beginParagraph(java.util.Map)
88    */
89    BEGIN_PARAGRAPH {
 
90  285 toggle @Override
91    public void fireEvent(Listener listener, Object[] eventParameters)
92    {
93  285 listener.beginParagraph((Map<String, String>) eventParameters[0]);
94    }
95    },
96    /**
97    * @see Listener#endParagraph(java.util.Map)
98    */
99    END_PARAGRAPH {
 
100  284 toggle @Override
101    public void fireEvent(Listener listener, Object[] eventParameters)
102    {
103  284 listener.endParagraph((Map<String, String>) eventParameters[0]);
104    }
105   
 
106  1 toggle @Override
107    public boolean isInlineEnd()
108    {
109  1 return true;
110    }
111    },
112    /**
113    * @see Listener#beginDefinitionList(java.util.Map)
114    */
115    BEGIN_DEFINITION_LIST {
 
116  20 toggle @Override
117    public void fireEvent(Listener listener, Object[] eventParameters)
118    {
119  20 listener.beginDefinitionList((Map<String, String>) eventParameters[0]);
120    }
121   
 
122  0 toggle @Override
123    public boolean isInlineEnd()
124    {
125    // This is because for nested definition lists, the event after a definition list item content is a new
126    // definition list
127  0 return true;
128    }
129    },
130    /**
131    * @see Listener#endDefinitionList(java.util.Map)
132    */
133    END_DEFINITION_LIST {
 
134  20 toggle @Override
135    public void fireEvent(Listener listener, Object[] eventParameters)
136    {
137  20 listener.endDefinitionList((Map<String, String>) eventParameters[0]);
138    }
139    },
140    /**
141    * @see Listener#beginDefinitionTerm()
142    */
143    BEGIN_DEFINITION_TERM {
 
144  14 toggle @Override
145    public void fireEvent(Listener listener, Object[] eventParameters)
146    {
147  14 listener.beginDefinitionTerm();
148    }
149    },
150    /**
151    * @see Listener#endDefinitionTerm()
152    */
153    END_DEFINITION_TERM {
 
154  14 toggle @Override
155    public void fireEvent(Listener listener, Object[] eventParameters)
156    {
157  14 listener.endDefinitionTerm();
158    }
159   
 
160  1 toggle @Override
161    public boolean isInlineEnd()
162    {
163  1 return true;
164    }
165    },
166    /**
167    * @see Listener#beginDefinitionDescription()
168    */
169    BEGIN_DEFINITION_DESCRIPTION {
 
170  18 toggle @Override
171    public void fireEvent(Listener listener, Object[] eventParameters)
172    {
173  18 listener.beginDefinitionDescription();
174    }
175    },
176    /**
177    * @see Listener#endDefinitionDescription()
178    */
179    END_DEFINITION_DESCRIPTION {
 
180  18 toggle @Override
181    public void fireEvent(Listener listener, Object[] eventParameters)
182    {
183  18 listener.endDefinitionDescription();
184    }
185   
 
186  1 toggle @Override
187    public boolean isInlineEnd()
188    {
189  1 return true;
190    }
191    },
192    /**
193    * @see Listener#beginFormat(org.xwiki.rendering.listener.Format, java.util.Map)
194    */
195    BEGIN_FORMAT {
 
196  88 toggle @Override
197    public void fireEvent(Listener listener, Object[] eventParameters)
198    {
199  88 listener.beginFormat((Format) eventParameters[0], (Map<String, String>) eventParameters[1]);
200    }
201    },
202    /**
203    * @see Listener#endFormat(org.xwiki.rendering.listener.Format, java.util.Map)
204    */
205    END_FORMAT {
 
206  88 toggle @Override
207    public void fireEvent(Listener listener, Object[] eventParameters)
208    {
209  88 listener.endFormat((Format) eventParameters[0], (Map<String, String>) eventParameters[1]);
210    }
211    },
212    /**
213    * @see Listener#beginHeader(org.xwiki.rendering.listener.HeaderLevel, String, java.util.Map)
214    */
215    BEGIN_HEADER {
 
216  50 toggle @Override
217    public void fireEvent(Listener listener, Object[] eventParameters)
218    {
219  50 listener.beginHeader((HeaderLevel) eventParameters[0], (String) eventParameters[1],
220    (Map<String, String>) eventParameters[2]);
221    }
222    },
223    /**
224    * @see Listener#endHeader(org.xwiki.rendering.listener.HeaderLevel, String, java.util.Map)
225    */
226    END_HEADER {
 
227  50 toggle @Override
228    public void fireEvent(Listener listener, Object[] eventParameters)
229    {
230  50 listener.endHeader((HeaderLevel) eventParameters[0], (String) eventParameters[1],
231    (Map<String, String>) eventParameters[2]);
232    }
233    },
234    /**
235    * @see Listener#beginLink(org.xwiki.rendering.listener.reference.ResourceReference, boolean, java.util.Map)
236    */
237    BEGIN_LINK {
 
238  79 toggle @Override
239    public void fireEvent(Listener listener, Object[] eventParameters)
240    {
241  79 listener.beginLink((ResourceReference) eventParameters[0], (Boolean) eventParameters[1],
242    (Map<String, String>) eventParameters[2]);
243    }
244    },
245    /**
246    * @see Listener#endLink(org.xwiki.rendering.listener.reference.ResourceReference, boolean, java.util.Map)
247    */
248    END_LINK {
 
249  79 toggle @Override
250    public void fireEvent(Listener listener, Object[] eventParameters)
251    {
252  79 listener.endLink((ResourceReference) eventParameters[0], (Boolean) eventParameters[1],
253    (Map<String, String>) eventParameters[2]);
254    }
255    },
256    /**
257    * @see Listener#beginList(org.xwiki.rendering.listener.ListType, java.util.Map)
258    */
259    BEGIN_LIST {
 
260  66 toggle @Override
261    public void fireEvent(Listener listener, Object[] eventParameters)
262    {
263  66 listener.beginList((ListType) eventParameters[0], (Map<String, String>) eventParameters[1]);
264    }
265   
 
266  1 toggle @Override
267    public boolean isInlineEnd()
268    {
269    // This is because for nested lists, the event after list item content is a new list
270  1 return true;
271    }
272    },
273    /**
274    * @see Listener#endList(org.xwiki.rendering.listener.ListType, java.util.Map)
275    */
276    END_LIST {
 
277  66 toggle @Override
278    public void fireEvent(Listener listener, Object[] eventParameters)
279    {
280  66 listener.endList((ListType) eventParameters[0], (Map<String, String>) eventParameters[1]);
281    }
282    },
283    /**
284    * @see org.xwiki.rendering.listener.Listener#beginListItem()
285    */
286    BEGIN_LIST_ITEM {
 
287  76 toggle @Override
288    public void fireEvent(Listener listener, Object[] eventParameters)
289    {
290  76 listener.beginListItem();
291    }
292    },
293    /**
294    * @see org.xwiki.rendering.listener.Listener#endListItem()
295    */
296    END_LIST_ITEM {
 
297  76 toggle @Override
298    public void fireEvent(Listener listener, Object[] eventParameters)
299    {
300  76 listener.endListItem();
301    }
302   
 
303  1 toggle @Override
304    public boolean isInlineEnd()
305    {
306  1 return true;
307    }
308    },
309    /**
310    * @see Listener#beginMacroMarker(String, java.util.Map, String, boolean)
311    */
312    BEGIN_MACRO_MARKER {
 
313  24 toggle @Override
314    public void fireEvent(Listener listener, Object[] eventParameters)
315    {
316  24 listener.beginMacroMarker((String) eventParameters[0], (Map<String, String>) eventParameters[1],
317    (String) eventParameters[2], (Boolean) eventParameters[3]);
318    }
319    },
320    /**
321    * @see Listener#endMacroMarker(String, java.util.Map, String, boolean)
322    */
323    END_MACRO_MARKER {
 
324  24 toggle @Override
325    public void fireEvent(Listener listener, Object[] eventParameters)
326    {
327  24 listener.endMacroMarker((String) eventParameters[0], (Map<String, String>) eventParameters[1],
328    (String) eventParameters[2], (Boolean) eventParameters[3]);
329    }
330    },
331    /**
332    * @see Listener#beginQuotation(java.util.Map)
333    */
334    BEGIN_QUOTATION {
 
335  9 toggle @Override
336    public void fireEvent(Listener listener, Object[] eventParameters)
337    {
338  9 listener.beginQuotation((Map<String, String>) eventParameters[0]);
339    }
340   
 
341  0 toggle @Override
342    public boolean isInlineEnd()
343    {
344    // This is because for nested quotations, the event after a quotation line is a new quotation
345  0 return true;
346    }
347    },
348    /**
349    * @see Listener#endQuotation(java.util.Map)
350    */
351    END_QUOTATION {
 
352  9 toggle @Override
353    public void fireEvent(Listener listener, Object[] eventParameters)
354    {
355  9 listener.endQuotation((Map<String, String>) eventParameters[0]);
356    }
357    },
358    /**
359    * @see org.xwiki.rendering.listener.Listener#beginQuotationLine()
360    */
361    BEGIN_QUOTATION_LINE {
 
362  16 toggle @Override
363    public void fireEvent(Listener listener, Object[] eventParameters)
364    {
365  16 listener.beginQuotationLine();
366    }
367    },
368    /**
369    * @see org.xwiki.rendering.listener.Listener#endQuotationLine()
370    */
371    END_QUOTATION_LINE {
 
372  16 toggle @Override
373    public void fireEvent(Listener listener, Object[] eventParameters)
374    {
375  16 listener.endQuotationLine();
376    }
377   
 
378  1 toggle @Override
379    public boolean isInlineEnd()
380    {
381  1 return true;
382    }
383    },
384    /**
385    * @see Listener#beginSection(java.util.Map)
386    */
387    BEGIN_SECTION {
 
388  55 toggle @Override
389    public void fireEvent(Listener listener, Object[] eventParameters)
390    {
391  55 listener.beginSection((Map<String, String>) eventParameters[0]);
392    }
393    },
394    /**
395    * @see Listener#endSection(java.util.Map)
396    */
397    END_SECTION {
 
398  55 toggle @Override
399    public void fireEvent(Listener listener, Object[] eventParameters)
400    {
401  55 listener.endSection((Map<String, String>) eventParameters[0]);
402    }
403    },
404    /**
405    * @see Listener#beginTable(java.util.Map)
406    */
407    BEGIN_TABLE {
 
408  21 toggle @Override
409    public void fireEvent(Listener listener, Object[] eventParameters)
410    {
411  21 listener.beginTable((Map<String, String>) eventParameters[0]);
412    }
413    },
414    /**
415    * @see Listener#endTable(java.util.Map)
416    */
417    END_TABLE {
 
418  21 toggle @Override
419    public void fireEvent(Listener listener, Object[] eventParameters)
420    {
421  21 listener.endTable((Map<String, String>) eventParameters[0]);
422    }
423    },
424    /**
425    * @see Listener#beginTableCell(java.util.Map)
426    */
427    BEGIN_TABLE_CELL {
 
428  53 toggle @Override
429    public void fireEvent(Listener listener, Object[] eventParameters)
430    {
431  53 listener.beginTableCell((Map<String, String>) eventParameters[0]);
432    }
433    },
434    /**
435    * @see Listener#endTableCell(java.util.Map)
436    */
437    END_TABLE_CELL {
 
438  53 toggle @Override
439    public void fireEvent(Listener listener, Object[] eventParameters)
440    {
441  53 listener.endTableCell((Map<String, String>) eventParameters[0]);
442    }
443   
 
444  1 toggle @Override
445    public boolean isInlineEnd()
446    {
447  1 return true;
448    }
449    },
450    /**
451    * @see Listener#beginTableHeadCell(java.util.Map)
452    */
453    BEGIN_TABLE_HEAD_CELL {
 
454  31 toggle @Override
455    public void fireEvent(Listener listener, Object[] eventParameters)
456    {
457  31 listener.beginTableHeadCell((Map<String, String>) eventParameters[0]);
458    }
459    },
460    /**
461    * @see Listener#endTableHeadCell(java.util.Map)
462    */
463    END_TABLE_HEAD_CELL {
 
464  31 toggle @Override
465    public void fireEvent(Listener listener, Object[] eventParameters)
466    {
467  31 listener.endTableHeadCell((Map<String, String>) eventParameters[0]);
468    }
469   
 
470  1 toggle @Override
471    public boolean isInlineEnd()
472    {
473  1 return true;
474    }
475    },
476    /**
477    * @see Listener#beginTableRow(java.util.Map)
478    */
479    BEGIN_TABLE_ROW {
 
480  39 toggle @Override
481    public void fireEvent(Listener listener, Object[] eventParameters)
482    {
483  39 listener.beginTableRow((Map<String, String>) eventParameters[0]);
484    }
485    },
486    /**
487    * @see Listener#endTableRow(java.util.Map)
488    */
489    END_TABLE_ROW {
 
490  39 toggle @Override
491    public void fireEvent(Listener listener, Object[] eventParameters)
492    {
493  39 listener.endTableRow((Map<String, String>) eventParameters[0]);
494    }
495    },
496    /**
497    * @see Listener#beginMetaData(org.xwiki.rendering.listener.MetaData)
498    */
499    BEGIN_METADATA {
 
500  0 toggle @Override
501    public void fireEvent(Listener listener, Object[] eventParameters)
502    {
503  0 listener.beginMetaData((