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
61   285   32   1.91
0   200   0.52   32
32     1  
1    
 
  ConsecutiveNewLineStateChainingListener       Line # 37 61 0% 32 0 100% 1.0
 
  (326)
 
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.syntax.Syntax;
30   
31    /**
32    * Counts consecutive new lines.
33    *
34    * @version $Id; $
35    * @since 1.8RC1
36    */
 
37    public class ConsecutiveNewLineStateChainingListener extends AbstractChainingListener implements
38    StackableChainingListener
39    {
40    /**
41    * Number of found new lines.
42    */
43    private int newLineCount;
44   
45    /**
46    * @param listenerChain see {@link #getListenerChain()}
47    */
 
48  379 toggle public ConsecutiveNewLineStateChainingListener(ListenerChain listenerChain)
49    {
50  379 setListenerChain(listenerChain);
51    }
52   
 
53  33 toggle @Override
54    public StackableChainingListener createChainingListenerInstance()
55    {
56  33 return new ConsecutiveNewLineStateChainingListener(getListenerChain());
57    }
58   
59    /**
60    * @return the number of found new lines.
61    */
 
62  89 toggle public int getNewLineCount()
63    {
64  89 return this.newLineCount;
65    }
66   
 
67  18 toggle @Override
68    public void endDefinitionDescription()
69    {
70  18 this.newLineCount = 0;
71  18 super.endDefinitionDescription();
72    }
73   
74    /**
75    * {@inheritDoc}
76    * @since 2.0RC1
77    */
 
78  20 toggle @Override
79    public void endDefinitionList(Map<String, String> parameters)
80    {
81  20 this.newLineCount = 0;
82  20 super.endDefinitionList(parameters);
83    }
84   
 
85  14 toggle @Override
86    public void endDefinitionTerm()
87    {
88  14 this.newLineCount = 0;
89  14 super.endDefinitionTerm();
90    }
91   
92    /**
93    * {@inheritDoc}
94    * @since 3.0M2
95    */
 
96  398 toggle @Override
97    public void endDocument(MetaData metaData)
98    {
99  398 this.newLineCount = 0;
100  398 super.endDocument(metaData);
101    }
102   
 
103  33 toggle @Override
104    public void endGroup(Map<String, String> parameters)
105    {
106  33 this.newLineCount = 0;
107  33 super.endGroup(parameters);
108    }
109   
 
110  86 toggle @Override
111    public void endFormat(Format format, Map<String, String> parameters)
112    {
113  86 this.newLineCount = 0;
114  86 super.endFormat(format, parameters);
115    }
116   
117    /**
118    * {@inheritDoc}
119    * @since 2.5RC1
120    */
 
121  78 toggle @Override
122    public void endLink(ResourceReference reference, boolean isFreeStandingURI, Map<String, String> parameters)
123    {
124  78 this.newLineCount = 0;
125  78 super.endLink(reference, isFreeStandingURI, parameters);
126    }
127   
 
128  66 toggle @Override
129    public void endList(ListType listType, Map<String, String> parameters)
130    {
131  66 this.newLineCount = 0;
132  66 super.endList(listType, parameters);
133    }
134   
 
135  76 toggle @Override
136    public void endListItem()
137    {
138  76 this.newLineCount = 0;
139  76 super.endListItem();
140    }
141   
 
142  24 toggle @Override
143    public void endMacroMarker(String name, Map<String, String> parameters, String content, boolean isInline)
144    {
145  24 this.newLineCount = 0;
146  24 super.endMacroMarker(name, parameters, content, isInline);
147    }
148   
 
149  283 toggle @Override
150    public void endParagraph(Map<String, String> parameters)
151    {
152  283 this.newLineCount = 0;
153  283 super.endParagraph(parameters);
154    }
155   
 
156  9 toggle @Override
157    public void endQuotation(Map<String, String> parameters)
158    {
159  9 this.newLineCount = 0;
160  9 super.endQuotation(parameters);
161    }
162   
 
163  16 toggle @Override
164    public void endQuotationLine()
165    {
166  16 this.newLineCount = 0;
167  16 super.endQuotationLine();
168    }
169   
 
170  50 toggle @Override
171    public void endHeader(HeaderLevel level, String id, Map<String, String> parameters)
172    {
173  50 this.newLineCount = 0;
174  50 super.endHeader(level, id, parameters);
175    }
176   
 
177  21 toggle @Override
178    public void endTable(Map<String, String> parameters)
179    {
180  21 this.newLineCount = 0;
181  21 super.endTable(parameters);
182    }
183   
 
184  53 toggle @Override
185    public void endTableCell(Map<String, String> parameters)
186    {
187  53 this.newLineCount = 0;
188  53 super.endTableCell(parameters);
189    }
190   
 
191  31 toggle @Override
192    public void endTableHeadCell(Map<String, String> parameters)
193    {
194  31 this.newLineCount = 0;
195  31 super.endTableHeadCell(parameters);
196    }
197   
 
198  39 toggle @Override
199    public void endTableRow(Map<String, String> parameters)
200    {
201  39 this.newLineCount = 0;
202  39 super.endTableRow(parameters);
203    }
204   
 
205  5 toggle @Override
206    public void onRawText(String text, Syntax syntax)
207    {
208  5 this.newLineCount = 0;
209  5 super.onRawText(text, syntax);
210    }
211   
 
212  8 toggle @Override
213    public void onEmptyLines(int count)
214    {
215  8 this.newLineCount = 0;
216  8 super.onEmptyLines(count);
217    }
218   
 
219  13 toggle @Override
220    public void onHorizontalLine(Map<String, String> parameters)
221    {
222  13 this.newLineCount = 0;
223  13 super.onHorizontalLine(parameters);
224    }
225   
 
226  6 toggle @Override
227    public void onId(String name)
228    {
229  6 this.newLineCount = 0;
230  6 super.onId(name);
231    }
232   
233    /**
234    * {@inheritDoc}
235    * @since 2.5RC1
236    */
 
237  39 toggle @Override
238    public void onImage(ResourceReference reference, boolean isFreeStandingURI, Map<String, String> parameters)
239    {
240  39 this.newLineCount = 0;
241  39 super.onImage(reference, isFreeStandingURI, parameters);
242    }
243   
 
244  90 toggle @Override
245    public void onNewLine()
246    {
247  90 this.newLineCount++;
248  90 super.onNewLine();
249    }
250   
 
251  552 toggle @Override
252    public void onSpace()
253    {
254  552 this.newLineCount = 0;
255  552 super.onSpace();
256    }
257   
 
258  289 toggle @Override
259    public void onSpecialSymbol(char symbol)
260    {
261  289 this.newLineCount = 0;
262  289 super.onSpecialSymbol(symbol);
263    }
264   
 
265  107 toggle @Override
266    public void onMacro(String id, Map<String, String> parameters, String content, boolean isInline)
267    {
268  107 this.newLineCount = 0;
269  107 super.onMacro(id, parameters, content, isInline);
270    }
271   
 
272  20 toggle @Override
273    public void onVerbatim(String protectedString, boolean isInline, Map<String, String> parameters)
274    {
275  20 this.newLineCount = 0;
276  20 super.onVerbatim(protectedString, isInline, parameters);
277    }
278   
 
279  1004 toggle @Override
280    public void onWord(String word)
281    {
282  1004 this.newLineCount = 0;
283  1004 super.onWord(word);
284    }
285    }