1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
package org.devacfr.maven.skins.reflow.snippet; |
20 |
|
|
21 |
|
import java.util.ArrayList; |
22 |
|
|
23 |
|
import org.jsoup.internal.StringUtil; |
24 |
|
|
25 |
|
|
26 |
|
@author |
27 |
|
@version |
28 |
|
|
|
|
| 66,7% |
Uncovered Elements: 8 (24) |
Complexity: 9 |
Complexity Density: 0,82 |
|
29 |
|
public class Components extends ArrayList<Component<?>> { |
30 |
|
|
31 |
|
|
32 |
|
private static final long serialVersionUID = 1L; |
33 |
|
|
34 |
|
|
35 |
|
private static final Components EMPTY = new Components(); |
36 |
|
|
37 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
38 |
0 |
public static Components empty() {... |
39 |
0 |
return EMPTY; |
40 |
|
} |
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
45 |
513 |
public Components() {... |
46 |
|
} |
47 |
|
|
48 |
|
|
49 |
|
@return |
50 |
|
|
|
|
| 91,7% |
Uncovered Elements: 1 (12) |
Complexity: 3 |
Complexity Density: 0,38 |
|
51 |
104 |
public String html() {... |
52 |
104 |
final StringBuilder sb = StringUtil.borrowBuilder(); |
53 |
104 |
for (final Component<?> component : this) { |
54 |
178 |
if (sb.length() != 0) { |
55 |
74 |
sb.append("\n"); |
56 |
|
} |
57 |
178 |
final String html = component.getHtml(); |
58 |
178 |
if (html != null) { |
59 |
178 |
sb.append(html); |
60 |
|
} |
61 |
|
} |
62 |
104 |
return StringUtil.releaseBuilder(sb); |
63 |
|
} |
64 |
|
|
65 |
|
|
66 |
|
|
67 |
|
|
68 |
|
@return |
69 |
|
|
|
|
| 66,7% |
Uncovered Elements: 1 (3) |
Complexity: 2 |
Complexity Density: 2 |
|
70 |
138 |
public Component<?> first() {... |
71 |
138 |
return isEmpty() ? null : get(0); |
72 |
|
} |
73 |
|
|
74 |
|
|
75 |
|
|
76 |
|
|
77 |
|
@return |
78 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 2 |
Complexity Density: 2 |
|
79 |
0 |
public Component<?> last() {... |
80 |
0 |
return isEmpty() ? null : get(size() - 1); |
81 |
|
} |
82 |
|
} |