1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
package info.magnolia.module.googlesitemap.bean; |
35 |
|
|
36 |
|
|
37 |
|
import javax.xml.bind.annotation.XmlElement; |
38 |
|
import javax.xml.bind.annotation.XmlRootElement; |
39 |
|
import javax.xml.bind.annotation.XmlTransient; |
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
@XmlRootElement(name="url") |
|
|
| 68.8% |
Uncovered Elements: 30 (96) |
Complexity: 34 |
Complexity Density: 0.6 |
|
46 |
|
public class SiteMapEntry implements Comparable<SiteMapEntry>{ |
47 |
|
|
48 |
|
|
49 |
|
private String loc; |
50 |
|
private String lastmod; |
51 |
|
private String changefreq; |
52 |
|
private String priority; |
53 |
|
|
54 |
|
|
55 |
|
private int level; |
56 |
|
private String path; |
57 |
|
private boolean styleAlert; |
58 |
|
private String pageName; |
59 |
|
private String from; |
60 |
|
private String to; |
61 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
62 |
0
|
public SiteMapEntry() {... |
63 |
|
} |
64 |
|
|
65 |
|
|
66 |
|
|
67 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
|
68 |
33
|
public SiteMapEntry(String loc, String lastmod, String changefreq, String priority, int level) {... |
69 |
33
|
this.loc = loc; |
70 |
33
|
this.lastmod = lastmod; |
71 |
33
|
this.changefreq = changefreq; |
72 |
33
|
this.priority = priority; |
73 |
33
|
this.level = level; |
74 |
|
} |
75 |
|
|
76 |
|
|
77 |
|
|
78 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
79 |
0
|
@XmlTransient... |
80 |
|
public String getTab() { |
81 |
0
|
String res = " "; |
82 |
0
|
for(int i=1;i<level;i++) { |
83 |
0
|
res += " "; |
84 |
|
} |
85 |
0
|
return res; |
86 |
|
} |
87 |
|
|
88 |
|
|
89 |
|
|
90 |
|
|
91 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
92 |
68
|
@XmlElement... |
93 |
|
public String getLoc() { |
94 |
68
|
return loc; |
95 |
|
} |
96 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
97 |
0
|
public void setLoc(String loc) {... |
98 |
0
|
this.loc = loc; |
99 |
|
} |
100 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
101 |
0
|
@XmlElement... |
102 |
|
public String getLastmod() { |
103 |
0
|
return lastmod; |
104 |
|
} |
105 |
|
|
106 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
107 |
0
|
public void setLastmod(String lastmod) {... |
108 |
0
|
this.lastmod = lastmod; |
109 |
|
} |
110 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
111 |
8
|
@XmlElement... |
112 |
|
public String getChangefreq() { |
113 |
8
|
return changefreq; |
114 |
|
} |
115 |
|
|
116 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
117 |
0
|
public void setChangefreq(String changefreq) {... |
118 |
0
|
this.changefreq = changefreq; |
119 |
|
} |
120 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
121 |
8
|
@XmlElement... |
122 |
|
public String getPriority() { |
123 |
8
|
return priority; |
124 |
|
} |
125 |
|
|
126 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
127 |
0
|
public void setPriority(String priority) {... |
128 |
0
|
this.priority = priority; |
129 |
|
} |
130 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
131 |
3
|
@XmlTransient... |
132 |
|
public int getLevel() { |
133 |
3
|
return level; |
134 |
|
} |
135 |
|
|
136 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
137 |
0
|
public void setLevel(int level) {... |
138 |
0
|
this.level = level; |
139 |
|
} |
140 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
141 |
1
|
@XmlTransient... |
142 |
|
public String getPath() { |
143 |
1
|
return path; |
144 |
|
} |
145 |
|
|
146 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
147 |
9
|
public void setPath(String path) {... |
148 |
9
|
this.path = path; |
149 |
|
} |
150 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
151 |
9
|
@XmlTransient... |
152 |
|
public boolean isStyleAlert() { |
153 |
9
|
return styleAlert; |
154 |
|
} |
155 |
|
|
156 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
157 |
9
|
public void setStyleAlert(boolean styleAlert) {... |
158 |
9
|
this.styleAlert = styleAlert; |
159 |
|
} |
160 |
|
|
161 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
162 |
0
|
@XmlTransient... |
163 |
|
public String getPageName() { |
164 |
0
|
return pageName; |
165 |
|
} |
166 |
|
|
167 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
168 |
6
|
public void setPageName(String pageName) {... |
169 |
6
|
this.pageName = pageName; |
170 |
|
} |
171 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
172 |
1
|
@XmlTransient... |
173 |
|
public String getFrom() { |
174 |
1
|
return from; |
175 |
|
} |
176 |
|
|
177 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
178 |
3
|
public void setFrom(String from) {... |
179 |
3
|
this.from = from; |
180 |
|
} |
181 |
|
|
182 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
183 |
3
|
public String getTo() {... |
184 |
3
|
return to; |
185 |
|
} |
186 |
|
|
187 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
188 |
3
|
public void setTo(String to) {... |
189 |
3
|
this.to = to; |
190 |
|
} |
191 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
|
192 |
33
|
public String toStringDisplay(){... |
193 |
33
|
StringBuffer sb = new StringBuffer(); |
194 |
33
|
sb.append("loc :"+loc); |
195 |
33
|
sb.append("lastmod :"+lastmod); |
196 |
33
|
sb.append("changefreq :"+changefreq); |
197 |
33
|
sb.append("priority :"+priority); |
198 |
33
|
return sb.toString(); |
199 |
|
} |
200 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
201 |
6
|
public String toStringSite(){... |
202 |
6
|
StringBuffer sb = new StringBuffer(); |
203 |
6
|
sb.append("path :"+path); |
204 |
6
|
sb.append("pageName :"+pageName); |
205 |
6
|
return sb.toString(); |
206 |
|
} |
207 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
|
208 |
3
|
public String toStringVirtualUri(){... |
209 |
3
|
StringBuffer sb = new StringBuffer(); |
210 |
3
|
sb.append("path :"+path); |
211 |
3
|
sb.append("from :"+from); |
212 |
3
|
sb.append("to :"+to); |
213 |
3
|
return sb.toString(); |
214 |
|
} |
215 |
|
|
216 |
|
|
217 |
|
|
218 |
|
|
|
|
| 55.6% |
Uncovered Elements: 4 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
219 |
9
|
@Override... |
220 |
|
public int compareTo(SiteMapEntry obj) { |
221 |
9
|
if(obj == null) { |
222 |
0
|
return -1; |
223 |
|
} |
224 |
|
|
225 |
9
|
if (obj==this) { |
226 |
0
|
return 0; |
227 |
|
} |
228 |
|
|
229 |
9
|
return (obj).getLoc().compareTo(this.getLoc()); |
230 |
|
|
231 |
|
} |
232 |
|
|
233 |
|
|
234 |
|
|
|
|
| 55.6% |
Uncovered Elements: 4 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
235 |
2
|
@Override... |
236 |
|
public boolean equals(Object obj) { |
237 |
|
|
238 |
2
|
if (obj==this) { |
239 |
0
|
return true; |
240 |
|
} |
241 |
|
|
242 |
|
|
243 |
2
|
if (obj instanceof SiteMapEntry) { |
244 |
2
|
return ((SiteMapEntry)obj).getLoc().equals(this.getLoc()); |
245 |
|
} |
246 |
|
|
247 |
0
|
return false; |
248 |
|
} |
249 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
250 |
16
|
@Override... |
251 |
|
public int hashCode() { |
252 |
16
|
int hash = 15; |
253 |
16
|
hash = hash * getLoc().hashCode(); |
254 |
16
|
return hash; |
255 |
|
} |
256 |
|
|
257 |
|
} |