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

File DivisionTagHandler.java

 

Coverage histogram

../../../../../../img/srcFileCovDistChart10.png
0% of files have more coverage

Code metrics

8
12
5
1
73
42
9
0.75
2.4
5
1.8

Classes

Class Line # Actions
DivisionTagHandler 31 12 0% 9 0
1.0100%
 

Contributing tests

This file is covered by 322 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.xhtml.handler;
21   
22    import java.util.Arrays;
23   
24    import org.xwiki.rendering.wikimodel.WikiParameter;
25    import org.xwiki.rendering.wikimodel.xhtml.impl.TagContext;
26   
27    /**
28    * @version $Id: bb005eb379536ba242a2f8ba7f1724bdc45a09b1 $
29    * @since 4.0M1
30    */
 
31    public class DivisionTagHandler extends BlockTagHandler
32    {
 
33  437 toggle public DivisionTagHandler()
34    {
35  437 super();
36    }
37   
 
38  294 toggle public DivisionTagHandler(String documentClass)
39    {
40  294 super(documentClass);
41    }
42   
 
43  292 toggle @Override
44    public boolean isBlockHandler(TagContext context)
45    {
46  292 WikiParameter param = context.getParams().getParameter("class");
47  292 if (param != null) {
48  176 if (Arrays.asList(param.getValue().split(" ")).contains("wikimodel-emptyline")) {
49  68 return true;
50    }
51    }
52   
53  224 return false;
54    }
55   
 
56  73 toggle @Override
57    protected void begin(TagContext context)
58    {
59  73 if (!isBlockHandler(context)) {
60  56 super.begin(context);
61    } else {
62  17 context.getTagStack().incrementEmptyLinesCount();
63    }
64    }
65   
 
66  73 toggle @Override
67    protected void end(TagContext context)
68    {
69  73 if (!isBlockHandler(context)) {
70  56 super.end(context);
71    }
72    }
73    }