Clover Coverage Report - Maven Cloud Front Plugin 1.0.16
Coverage timestamp: Sun Feb 6 2011 11:45:42 EST
../../../../../img/srcFileCovDistChart0.png 9% of files have more coverage
23   63   9   3.29
4   44   0.39   7
7     1.29  
1    
 
  HtmlUtils       Line # 8 23 0% 9 34 0% 0.0
 
No Tests
 
1    package org.kuali.maven.mojo.s3;
2   
3    import org.apache.commons.lang.StringUtils;
4   
5    /**
6    * Utility methods for generating html
7    */
 
8    public class HtmlUtils {
9   
10    int indent = 0;
11   
 
12  0 toggle public String getIndentedContent(final String content) {
13  0 return getIndent() + content;
14    }
15   
 
16  0 toggle public String getIndent() {
17  0 return StringUtils.repeat(" ", indent);
18    }
19   
20    /**
21    * Return an HTML ahref tag
22    */
 
23  0 toggle public String getHref(final String dest, final String show) {
24  0 return getIndent() + "<a href=\"" + dest + "\">" + show + "</a>";
25    }
26   
27    /**
28    * Return an HTML img tag
29    */
 
30  0 toggle public String getImage(final String image) {
31  0 return getIndent() + "<img src=\"" + image + "\">";
32    }
33   
 
34  0 toggle public String openTag(final Tag tag) {
35  0 StringBuffer sb = new StringBuffer();
36  0 sb.append(getIndent());
37  0 indent++;
38  0 sb.append("<" + tag.getName());
39  0 if (tag.getId() != null) {
40  0 sb.append(" id=\"" + tag.getId() + '"');
41    }
42  0 if (tag.getClazz() != null) {
43  0 sb.append(" class=\"" + tag.getClazz() + '"');
44    }
45  0 sb.append(">\n");
46  0 return sb.toString();
47    }
48   
 
49  0 toggle public String closeTag(final Tag tag) {
50  0 indent--;
51  0 return getIndent() + "</" + tag.getName() + ">\n";
52    }
53   
 
54  0 toggle public String getTag(final Tag tag, final String content) {
55  0 StringBuffer sb = new StringBuffer();
56  0 sb.append(openTag(tag));
57  0 sb.append(getIndent());
58  0 sb.append(content);
59  0 sb.append("\n");
60  0 sb.append(closeTag(tag));
61  0 return sb.toString();
62    }
63    }