Clover Coverage Report - XWiki Rendering - Parent POM 4.0-SNAPSHOT (Aggregated)
Coverage timestamp: Mon Mar 12 2012 18:03:13 CET
../../../../img/srcFileCovDistChart9.png 55% of files have more coverage
9   98   6   1.5
0   37   0.67   6
6     1  
1    
 
  VerbatimBlock       Line # 32 9 0% 6 2 86.7% 0.8666667
 
  (56)
 
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.block;
21   
22    import java.util.Map;
23   
24    import org.xwiki.rendering.listener.Listener;
25   
26    /**
27    * A Verbatim block.
28    *
29    * @version $Id: 814a56bbdfbc96d5dd30353c921734d439d3de55 $
30    * @since 1.8M2
31    */
 
32    public class VerbatimBlock extends AbstractBlock
33    {
34    /**
35    * The string to protect from rendering.
36    */
37    private String protectedString;
38   
39    /**
40    * If true the macro is located in a inline content (like paragraph, etc.).
41    */
42    private boolean isInline;
43   
44    /**
45    * @param protectedString the string to protect from rendering.
46    * @param isInline if true the macro is located in a inline content (like paragraph, etc.).
47    */
 
48  22 toggle public VerbatimBlock(String protectedString, boolean isInline)
49    {
50  22 this.protectedString = protectedString;
51  22 this.isInline = isInline;
52    }
53   
54    /**
55    * @param protectedString the string to protect from rendering.
56    * @param parameters the custom parameters
57    * @param isInline if true the macro is located in a inline content (like paragraph, etc.).
58    */
 
59  61 toggle public VerbatimBlock(String protectedString, Map<String, String> parameters, boolean isInline)
60    {
61  61 super(parameters);
62   
63  61 this.protectedString = protectedString;
64  61 this.isInline = isInline;
65    }
66   
67    /**
68    * @return the string to protect from rendering
69    */
 
70  83 toggle public String getProtectedString()
71    {
72  83 return this.protectedString;
73    }
74   
75    /**
76    * @return if true the macro is located in a inline content (like paragraph, etc.).
77    */
 
78  83 toggle public boolean isInline()
79    {
80  83 return this.isInline;
81    }
82   
 
83  83 toggle @Override
84    public void traverse(Listener listener)
85    {
86  83 listener.onVerbatim(getProtectedString(), isInline(), getParameters());
87    }
88   
89    /**
90    * {@inheritDoc}
91    * @since 1.8RC2
92    */
 
93  0 toggle @Override
94    public String toString()
95    {
96  0 return getProtectedString();
97    }
98    }