Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
DecorationModel |
|
| 2.696969696969697;2,697 |
1 | /* | |
2 | =================== DO NOT EDIT THIS FILE ==================== | |
3 | Generated by Modello 1.4.1 on 2011-04-27 00:03:43, | |
4 | any modifications will be overwritten. | |
5 | ============================================================== | |
6 | */ | |
7 | ||
8 | package org.apache.maven.doxia.site.decoration; | |
9 | ||
10 | /** | |
11 | * | |
12 | * The <code><project></code> element is the root of | |
13 | * the site decoration descriptor. | |
14 | * The following table lists all of the possible child | |
15 | * elements. | |
16 | * | |
17 | * | |
18 | * @version $Revision$ $Date$ | |
19 | */ | |
20 | @SuppressWarnings( "all" ) | |
21 | 462 | public class DecorationModel |
22 | implements java.io.Serializable, java.lang.Cloneable | |
23 | { | |
24 | ||
25 | //--------------------------/ | |
26 | //- Class/Member Variables -/ | |
27 | //--------------------------/ | |
28 | ||
29 | /** | |
30 | * The full name of the project. | |
31 | */ | |
32 | private String name; | |
33 | ||
34 | /** | |
35 | * Banner logo on the masthead of the site to the left. | |
36 | */ | |
37 | private Banner bannerLeft; | |
38 | ||
39 | /** | |
40 | * Banner logo on the masthead of the site to the right. | |
41 | */ | |
42 | private Banner bannerRight; | |
43 | ||
44 | /** | |
45 | * The id for your Google Analytics account. | |
46 | */ | |
47 | private String googleAnalyticsAccountId; | |
48 | ||
49 | /** | |
50 | * Modify the date published display properties. | |
51 | */ | |
52 | private PublishDate publishDate; | |
53 | ||
54 | /** | |
55 | * Modify the version published display properties. | |
56 | */ | |
57 | private Version version; | |
58 | ||
59 | /** | |
60 | * Field poweredBy. | |
61 | */ | |
62 | private java.util.List<Logo> poweredBy; | |
63 | ||
64 | /** | |
65 | * The artifact containing the skin for the site. | |
66 | */ | |
67 | private Skin skin; | |
68 | ||
69 | /** | |
70 | * The main site content decoration. | |
71 | */ | |
72 | private Body body; | |
73 | ||
74 | /** | |
75 | * Custom configuration for use with customized Velocity | |
76 | * templates. | |
77 | */ | |
78 | private Object custom; | |
79 | ||
80 | /** | |
81 | * Timestamp of the last modification of this decoration model. | |
82 | */ | |
83 | 462 | private long lastModified = 0L; |
84 | ||
85 | /** | |
86 | * Field modelEncoding. | |
87 | */ | |
88 | 462 | private String modelEncoding = "UTF-8"; |
89 | ||
90 | ||
91 | //-----------/ | |
92 | //- Methods -/ | |
93 | //-----------/ | |
94 | ||
95 | /** | |
96 | * Method addPoweredBy. | |
97 | * | |
98 | * @param logo | |
99 | */ | |
100 | public void addPoweredBy( Logo logo ) | |
101 | { | |
102 | 30 | getPoweredBy().add( logo ); |
103 | 30 | } //-- void addPoweredBy( Logo ) |
104 | ||
105 | /** | |
106 | * Method clone. | |
107 | * | |
108 | * @return DecorationModel | |
109 | */ | |
110 | public DecorationModel clone() | |
111 | { | |
112 | try | |
113 | { | |
114 | 0 | DecorationModel copy = (DecorationModel) super.clone(); |
115 | ||
116 | 0 | if ( this.bannerLeft != null ) |
117 | { | |
118 | 0 | copy.bannerLeft = (Banner) this.bannerLeft.clone(); |
119 | } | |
120 | ||
121 | 0 | if ( this.bannerRight != null ) |
122 | { | |
123 | 0 | copy.bannerRight = (Banner) this.bannerRight.clone(); |
124 | } | |
125 | ||
126 | 0 | if ( this.publishDate != null ) |
127 | { | |
128 | 0 | copy.publishDate = (PublishDate) this.publishDate.clone(); |
129 | } | |
130 | ||
131 | 0 | if ( this.version != null ) |
132 | { | |
133 | 0 | copy.version = (Version) this.version.clone(); |
134 | } | |
135 | ||
136 | 0 | if ( this.poweredBy != null ) |
137 | { | |
138 | 0 | copy.poweredBy = new java.util.ArrayList<Logo>(); |
139 | 0 | for ( Logo item : this.poweredBy ) |
140 | { | |
141 | 0 | copy.poweredBy.add( ( (Logo) item).clone() ); |
142 | } | |
143 | } | |
144 | ||
145 | 0 | if ( this.skin != null ) |
146 | { | |
147 | 0 | copy.skin = (Skin) this.skin.clone(); |
148 | } | |
149 | ||
150 | 0 | if ( this.body != null ) |
151 | { | |
152 | 0 | copy.body = (Body) this.body.clone(); |
153 | } | |
154 | ||
155 | 0 | if ( this.custom != null ) |
156 | { | |
157 | 0 | copy.custom = new org.codehaus.plexus.util.xml.Xpp3Dom( (org.codehaus.plexus.util.xml.Xpp3Dom) this.custom ); |
158 | } | |
159 | ||
160 | 0 | return copy; |
161 | } | |
162 | 0 | catch ( java.lang.Exception ex ) |
163 | { | |
164 | 0 | throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName() |
165 | + " does not support clone()" ).initCause( ex ); | |
166 | } | |
167 | } //-- DecorationModel clone() | |
168 | ||
169 | /** | |
170 | * Method equals. | |
171 | * | |
172 | * @param other | |
173 | * @return boolean | |
174 | */ | |
175 | public boolean equals( Object other ) | |
176 | { | |
177 | 162 | if ( this == other ) |
178 | { | |
179 | 0 | return true; |
180 | } | |
181 | ||
182 | 162 | if ( !( other instanceof DecorationModel ) ) |
183 | { | |
184 | 0 | return false; |
185 | } | |
186 | ||
187 | 162 | DecorationModel that = (DecorationModel) other; |
188 | 162 | boolean result = true; |
189 | ||
190 | 162 | result = result && ( getName() == null ? that.getName() == null : getName().equals( that.getName() ) ); |
191 | 162 | result = result && ( getBannerLeft() == null ? that.getBannerLeft() == null : getBannerLeft().equals( that.getBannerLeft() ) ); |
192 | 162 | result = result && ( getBannerRight() == null ? that.getBannerRight() == null : getBannerRight().equals( that.getBannerRight() ) ); |
193 | 162 | result = result && ( getGoogleAnalyticsAccountId() == null ? that.getGoogleAnalyticsAccountId() == null : getGoogleAnalyticsAccountId().equals( that.getGoogleAnalyticsAccountId() ) ); |
194 | 162 | result = result && ( getPublishDate() == null ? that.getPublishDate() == null : getPublishDate().equals( that.getPublishDate() ) ); |
195 | 162 | result = result && ( getVersion() == null ? that.getVersion() == null : getVersion().equals( that.getVersion() ) ); |
196 | 162 | result = result && ( getPoweredBy() == null ? that.getPoweredBy() == null : getPoweredBy().equals( that.getPoweredBy() ) ); |
197 | 162 | result = result && ( getSkin() == null ? that.getSkin() == null : getSkin().equals( that.getSkin() ) ); |
198 | 162 | result = result && ( getBody() == null ? that.getBody() == null : getBody().equals( that.getBody() ) ); |
199 | 162 | result = result && ( getCustom() == null ? that.getCustom() == null : getCustom().equals( that.getCustom() ) ); |
200 | ||
201 | 162 | return result; |
202 | } //-- boolean equals( Object ) | |
203 | ||
204 | /** | |
205 | * Get banner logo on the masthead of the site to the left. | |
206 | * | |
207 | * @return Banner | |
208 | */ | |
209 | public Banner getBannerLeft() | |
210 | { | |
211 | 1314 | return this.bannerLeft; |
212 | } //-- Banner getBannerLeft() | |
213 | ||
214 | /** | |
215 | * Get banner logo on the masthead of the site to the right. | |
216 | * | |
217 | * @return Banner | |
218 | */ | |
219 | public Banner getBannerRight() | |
220 | { | |
221 | 1302 | return this.bannerRight; |
222 | } //-- Banner getBannerRight() | |
223 | ||
224 | /** | |
225 | * Get the main site content decoration. | |
226 | * | |
227 | * @return Body | |
228 | */ | |
229 | public Body getBody() | |
230 | { | |
231 | 1488 | return this.body; |
232 | } //-- Body getBody() | |
233 | ||
234 | /** | |
235 | * Get custom configuration for use with customized Velocity | |
236 | * templates. | |
237 | * | |
238 | * @return Object | |
239 | */ | |
240 | public Object getCustom() | |
241 | { | |
242 | 750 | return this.custom; |
243 | } //-- Object getCustom() | |
244 | ||
245 | /** | |
246 | * Get the id for your Google Analytics account. | |
247 | * | |
248 | * @return String | |
249 | */ | |
250 | public String getGoogleAnalyticsAccountId() | |
251 | { | |
252 | 324 | return this.googleAnalyticsAccountId; |
253 | } //-- String getGoogleAnalyticsAccountId() | |
254 | ||
255 | /** | |
256 | * Get timestamp of the last modification of this decoration | |
257 | * model. | |
258 | * | |
259 | * @return long | |
260 | */ | |
261 | public long getLastModified() | |
262 | { | |
263 | 372 | return this.lastModified; |
264 | } //-- long getLastModified() | |
265 | ||
266 | /** | |
267 | * Get the modelEncoding field. | |
268 | * | |
269 | * @return String | |
270 | */ | |
271 | public String getModelEncoding() | |
272 | { | |
273 | 0 | return this.modelEncoding; |
274 | } //-- String getModelEncoding() | |
275 | ||
276 | /** | |
277 | * Get the full name of the project. | |
278 | * | |
279 | * @return String | |
280 | */ | |
281 | public String getName() | |
282 | { | |
283 | 480 | return this.name; |
284 | } //-- String getName() | |
285 | ||
286 | /** | |
287 | * Method getPoweredBy. | |
288 | * | |
289 | * @return List | |
290 | */ | |
291 | public java.util.List<Logo> getPoweredBy() | |
292 | { | |
293 | 1080 | if ( this.poweredBy == null ) |
294 | { | |
295 | 270 | this.poweredBy = new java.util.ArrayList<Logo>(); |
296 | } | |
297 | ||
298 | 1080 | return this.poweredBy; |
299 | } //-- java.util.List<Logo> getPoweredBy() | |
300 | ||
301 | /** | |
302 | * Get modify the date published display properties. | |
303 | * | |
304 | * @return PublishDate | |
305 | */ | |
306 | public PublishDate getPublishDate() | |
307 | { | |
308 | 738 | return this.publishDate; |
309 | } //-- PublishDate getPublishDate() | |
310 | ||
311 | /** | |
312 | * Get the artifact containing the skin for the site. | |
313 | * | |
314 | * @return Skin | |
315 | */ | |
316 | public Skin getSkin() | |
317 | { | |
318 | 768 | return this.skin; |
319 | } //-- Skin getSkin() | |
320 | ||
321 | /** | |
322 | * Get modify the version published display properties. | |
323 | * | |
324 | * @return Version | |
325 | */ | |
326 | public Version getVersion() | |
327 | { | |
328 | 738 | return this.version; |
329 | } //-- Version getVersion() | |
330 | ||
331 | /** | |
332 | * Method hashCode. | |
333 | * | |
334 | * @return int | |
335 | */ | |
336 | public int hashCode() | |
337 | { | |
338 | 0 | int result = 17; |
339 | ||
340 | 0 | result = 37 * result + ( name != null ? name.hashCode() : 0 ); |
341 | 0 | result = 37 * result + ( bannerLeft != null ? bannerLeft.hashCode() : 0 ); |
342 | 0 | result = 37 * result + ( bannerRight != null ? bannerRight.hashCode() : 0 ); |
343 | 0 | result = 37 * result + ( googleAnalyticsAccountId != null ? googleAnalyticsAccountId.hashCode() : 0 ); |
344 | 0 | result = 37 * result + ( publishDate != null ? publishDate.hashCode() : 0 ); |
345 | 0 | result = 37 * result + ( version != null ? version.hashCode() : 0 ); |
346 | 0 | result = 37 * result + ( poweredBy != null ? poweredBy.hashCode() : 0 ); |
347 | 0 | result = 37 * result + ( skin != null ? skin.hashCode() : 0 ); |
348 | 0 | result = 37 * result + ( body != null ? body.hashCode() : 0 ); |
349 | 0 | result = 37 * result + ( custom != null ? custom.hashCode() : 0 ); |
350 | ||
351 | 0 | return result; |
352 | } //-- int hashCode() | |
353 | ||
354 | /** | |
355 | * Method removePoweredBy. | |
356 | * | |
357 | * @param logo | |
358 | */ | |
359 | public void removePoweredBy( Logo logo ) | |
360 | { | |
361 | 0 | getPoweredBy().remove( logo ); |
362 | 0 | } //-- void removePoweredBy( Logo ) |
363 | ||
364 | /** | |
365 | * Set banner logo on the masthead of the site to the left. | |
366 | * | |
367 | * @param bannerLeft | |
368 | */ | |
369 | public void setBannerLeft( Banner bannerLeft ) | |
370 | { | |
371 | 306 | this.bannerLeft = bannerLeft; |
372 | 306 | } //-- void setBannerLeft( Banner ) |
373 | ||
374 | /** | |
375 | * Set banner logo on the masthead of the site to the right. | |
376 | * | |
377 | * @param bannerRight | |
378 | */ | |
379 | public void setBannerRight( Banner bannerRight ) | |
380 | { | |
381 | 300 | this.bannerRight = bannerRight; |
382 | 300 | } //-- void setBannerRight( Banner ) |
383 | ||
384 | /** | |
385 | * Set the main site content decoration. | |
386 | * | |
387 | * @param body | |
388 | */ | |
389 | public void setBody( Body body ) | |
390 | { | |
391 | 390 | this.body = body; |
392 | 390 | } //-- void setBody( Body ) |
393 | ||
394 | /** | |
395 | * Set custom configuration for use with customized Velocity | |
396 | * templates. | |
397 | * | |
398 | * @param custom | |
399 | */ | |
400 | public void setCustom( Object custom ) | |
401 | { | |
402 | 240 | this.custom = custom; |
403 | 240 | } //-- void setCustom( Object ) |
404 | ||
405 | /** | |
406 | * Set the id for your Google Analytics account. | |
407 | * | |
408 | * @param googleAnalyticsAccountId | |
409 | */ | |
410 | public void setGoogleAnalyticsAccountId( String googleAnalyticsAccountId ) | |
411 | { | |
412 | 0 | this.googleAnalyticsAccountId = googleAnalyticsAccountId; |
413 | 0 | } //-- void setGoogleAnalyticsAccountId( String ) |
414 | ||
415 | /** | |
416 | * Set timestamp of the last modification of this decoration | |
417 | * model. | |
418 | * | |
419 | * @param lastModified | |
420 | */ | |
421 | public void setLastModified( long lastModified ) | |
422 | { | |
423 | 0 | this.lastModified = lastModified; |
424 | 0 | } //-- void setLastModified( long ) |
425 | ||
426 | /** | |
427 | * Set the modelEncoding field. | |
428 | * | |
429 | * @param modelEncoding | |
430 | */ | |
431 | public void setModelEncoding( String modelEncoding ) | |
432 | { | |
433 | 360 | this.modelEncoding = modelEncoding; |
434 | 360 | } //-- void setModelEncoding( String ) |
435 | ||
436 | /** | |
437 | * Set the full name of the project. | |
438 | * | |
439 | * @param name | |
440 | */ | |
441 | public void setName( String name ) | |
442 | { | |
443 | 360 | this.name = name; |
444 | 360 | } //-- void setName( String ) |
445 | ||
446 | /** | |
447 | * Set powered by logos list. | |
448 | * | |
449 | * @param poweredBy | |
450 | */ | |
451 | public void setPoweredBy( java.util.List<Logo> poweredBy ) | |
452 | { | |
453 | 378 | this.poweredBy = poweredBy; |
454 | 378 | } //-- void setPoweredBy( java.util.List ) |
455 | ||
456 | /** | |
457 | * Set modify the date published display properties. | |
458 | * | |
459 | * @param publishDate | |
460 | */ | |
461 | public void setPublishDate( PublishDate publishDate ) | |
462 | { | |
463 | 66 | this.publishDate = publishDate; |
464 | 66 | } //-- void setPublishDate( PublishDate ) |
465 | ||
466 | /** | |
467 | * Set the artifact containing the skin for the site. | |
468 | * | |
469 | * @param skin | |
470 | */ | |
471 | public void setSkin( Skin skin ) | |
472 | { | |
473 | 96 | this.skin = skin; |
474 | 96 | } //-- void setSkin( Skin ) |
475 | ||
476 | /** | |
477 | * Set modify the version published display properties. | |
478 | * | |
479 | * @param version | |
480 | */ | |
481 | public void setVersion( Version version ) | |
482 | { | |
483 | 66 | this.version = version; |
484 | 66 | } //-- void setVersion( Version ) |
485 | ||
486 | /** | |
487 | * Method toString. | |
488 | * | |
489 | * @return String | |
490 | */ | |
491 | public java.lang.String toString() | |
492 | { | |
493 | 0 | StringBuilder buf = new StringBuilder( 128 ); |
494 | ||
495 | 0 | buf.append( "name = '" ); |
496 | 0 | buf.append( getName() ); |
497 | 0 | buf.append( "'" ); |
498 | 0 | buf.append( "\n" ); |
499 | 0 | buf.append( "bannerLeft = '" ); |
500 | 0 | buf.append( getBannerLeft() ); |
501 | 0 | buf.append( "'" ); |
502 | 0 | buf.append( "\n" ); |
503 | 0 | buf.append( "bannerRight = '" ); |
504 | 0 | buf.append( getBannerRight() ); |
505 | 0 | buf.append( "'" ); |
506 | 0 | buf.append( "\n" ); |
507 | 0 | buf.append( "googleAnalyticsAccountId = '" ); |
508 | 0 | buf.append( getGoogleAnalyticsAccountId() ); |
509 | 0 | buf.append( "'" ); |
510 | 0 | buf.append( "\n" ); |
511 | 0 | buf.append( "publishDate = '" ); |
512 | 0 | buf.append( getPublishDate() ); |
513 | 0 | buf.append( "'" ); |
514 | 0 | buf.append( "\n" ); |
515 | 0 | buf.append( "version = '" ); |
516 | 0 | buf.append( getVersion() ); |
517 | 0 | buf.append( "'" ); |
518 | 0 | buf.append( "\n" ); |
519 | 0 | buf.append( "poweredBy = '" ); |
520 | 0 | buf.append( getPoweredBy() ); |
521 | 0 | buf.append( "'" ); |
522 | 0 | buf.append( "\n" ); |
523 | 0 | buf.append( "skin = '" ); |
524 | 0 | buf.append( getSkin() ); |
525 | 0 | buf.append( "'" ); |
526 | 0 | buf.append( "\n" ); |
527 | 0 | buf.append( "body = '" ); |
528 | 0 | buf.append( getBody() ); |
529 | 0 | buf.append( "'" ); |
530 | 0 | buf.append( "\n" ); |
531 | 0 | buf.append( "custom = '" ); |
532 | 0 | buf.append( getCustom() ); |
533 | 0 | buf.append( "'" ); |
534 | ||
535 | 0 | return buf.toString(); |
536 | } //-- java.lang.String toString() | |
537 | ||
538 | ||
539 | ||
540 | private java.util.Map<String, Menu> menusByRef; | |
541 | ||
542 | /** | |
543 | * @param key not null | |
544 | * @return the menu ref defined by the given key. | |
545 | */ | |
546 | public Menu getMenuRef( String key ) | |
547 | { | |
548 | 0 | if ( menusByRef == null ) |
549 | { | |
550 | 0 | menusByRef = new java.util.HashMap<String, Menu>(); |
551 | ||
552 | 0 | if ( body != null ) |
553 | { | |
554 | 0 | for ( Menu menu : body.getMenus() ) |
555 | { | |
556 | 0 | if ( menu.getRef() != null ) |
557 | { | |
558 | 0 | menusByRef.put( menu.getRef(), menu ); |
559 | } | |
560 | } | |
561 | } | |
562 | } | |
563 | 0 | return menusByRef.get( key ); |
564 | } | |
565 | ||
566 | /** | |
567 | * @param key not null | |
568 | */ | |
569 | public void removeMenuRef( String key ) | |
570 | { | |
571 | 0 | if ( body != null ) |
572 | { | |
573 | 0 | for ( java.util.Iterator<Menu> i = body.getMenus().iterator(); i.hasNext(); ) |
574 | { | |
575 | 0 | Menu menu = i.next(); |
576 | 0 | if ( key.equals( menu.getRef() ) ) |
577 | { | |
578 | 0 | i.remove(); |
579 | } | |
580 | 0 | } |
581 | } | |
582 | 0 | } |
583 | ||
584 | /** | |
585 | * @return the menus list or EMPTY_LIST. | |
586 | */ | |
587 | public java.util.List<Menu> getMenus() | |
588 | { | |
589 | java.util.List menus; | |
590 | 0 | if ( body != null && body.getMenus() != null ) |
591 | { | |
592 | 0 | menus = body.getMenus(); |
593 | } | |
594 | else | |
595 | { | |
596 | 0 | menus = java.util.Collections.emptyList(); |
597 | } | |
598 | 0 | return menus; |
599 | } | |
600 | ||
601 | ||
602 | } |