| 1 |
|
package org.kuali.maven.mojo.s3; |
| 2 |
|
|
| 3 |
|
import org.apache.commons.lang.StringUtils; |
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
|
|
|
| 0% |
Uncovered Elements: 34 (34) |
Complexity: 9 |
Complexity Density: 0.39 |
|
| 8 |
|
public class HtmlUtils { |
| 9 |
|
|
| 10 |
|
int indent = 0; |
| 11 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 12 |
0
|
public String getIndentedContent(final String content) {... |
| 13 |
0
|
return getIndent() + content; |
| 14 |
|
} |
| 15 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 16 |
0
|
public String getIndent() {... |
| 17 |
0
|
return StringUtils.repeat(" ", indent); |
| 18 |
|
} |
| 19 |
|
|
| 20 |
|
|
| 21 |
|
|
| 22 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 23 |
0
|
public String getHref(final String dest, final String show) {... |
| 24 |
0
|
return getIndent() + "<a href=\"" + dest + "\">" + show + "</a>"; |
| 25 |
|
} |
| 26 |
|
|
| 27 |
|
|
| 28 |
|
|
| 29 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 30 |
0
|
public String getImage(final String image) {... |
| 31 |
0
|
return getIndent() + "<img src=\"" + image + "\">"; |
| 32 |
|
} |
| 33 |
|
|
|
|
|
| 0% |
Uncovered Elements: 14 (14) |
Complexity: 3 |
Complexity Density: 0.3 |
|
| 34 |
0
|
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 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 49 |
0
|
public String closeTag(final Tag tag) {... |
| 50 |
0
|
indent--; |
| 51 |
0
|
return getIndent() + "</" + tag.getName() + ">\n"; |
| 52 |
|
} |
| 53 |
|
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 1 |
Complexity Density: 0.14 |
|
| 54 |
0
|
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 |
|
} |