View Javadoc

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>&lt;project&gt;</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  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      private long lastModified = 0L;
84  
85      /**
86       * Field modelEncoding.
87       */
88      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         getPoweredBy().add( logo );
103     } //-- void addPoweredBy( Logo )
104 
105     /**
106      * Method clone.
107      * 
108      * @return DecorationModel
109      */
110     public DecorationModel clone()
111     {
112         try
113         {
114             DecorationModel copy = (DecorationModel) super.clone();
115 
116             if ( this.bannerLeft != null )
117             {
118                 copy.bannerLeft = (Banner) this.bannerLeft.clone();
119             }
120 
121             if ( this.bannerRight != null )
122             {
123                 copy.bannerRight = (Banner) this.bannerRight.clone();
124             }
125 
126             if ( this.publishDate != null )
127             {
128                 copy.publishDate = (PublishDate) this.publishDate.clone();
129             }
130 
131             if ( this.version != null )
132             {
133                 copy.version = (Version) this.version.clone();
134             }
135 
136             if ( this.poweredBy != null )
137             {
138                 copy.poweredBy = new java.util.ArrayList<Logo>();
139                 for ( Logo item : this.poweredBy )
140                 {
141                     copy.poweredBy.add( ( (Logo) item).clone() );
142                 }
143             }
144 
145             if ( this.skin != null )
146             {
147                 copy.skin = (Skin) this.skin.clone();
148             }
149 
150             if ( this.body != null )
151             {
152                 copy.body = (Body) this.body.clone();
153             }
154 
155             if ( this.custom != null )
156             {
157                 copy.custom = new org.codehaus.plexus.util.xml.Xpp3Dom( (org.codehaus.plexus.util.xml.Xpp3Dom) this.custom );
158             }
159 
160             return copy;
161         }
162         catch ( java.lang.Exception ex )
163         {
164             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         if ( this == other )
178         {
179             return true;
180         }
181 
182         if ( !( other instanceof DecorationModel ) )
183         {
184             return false;
185         }
186 
187         DecorationModel that = (DecorationModel) other;
188         boolean result = true;
189 
190         result = result && ( getName() == null ? that.getName() == null : getName().equals( that.getName() ) );
191         result = result && ( getBannerLeft() == null ? that.getBannerLeft() == null : getBannerLeft().equals( that.getBannerLeft() ) );
192         result = result && ( getBannerRight() == null ? that.getBannerRight() == null : getBannerRight().equals( that.getBannerRight() ) );
193         result = result && ( getGoogleAnalyticsAccountId() == null ? that.getGoogleAnalyticsAccountId() == null : getGoogleAnalyticsAccountId().equals( that.getGoogleAnalyticsAccountId() ) );
194         result = result && ( getPublishDate() == null ? that.getPublishDate() == null : getPublishDate().equals( that.getPublishDate() ) );
195         result = result && ( getVersion() == null ? that.getVersion() == null : getVersion().equals( that.getVersion() ) );
196         result = result && ( getPoweredBy() == null ? that.getPoweredBy() == null : getPoweredBy().equals( that.getPoweredBy() ) );
197         result = result && ( getSkin() == null ? that.getSkin() == null : getSkin().equals( that.getSkin() ) );
198         result = result && ( getBody() == null ? that.getBody() == null : getBody().equals( that.getBody() ) );
199         result = result && ( getCustom() == null ? that.getCustom() == null : getCustom().equals( that.getCustom() ) );
200 
201         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         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         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         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         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         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         return this.lastModified;
264     } //-- long getLastModified()
265 
266     /**
267      * Get the modelEncoding field.
268      * 
269      * @return String
270      */
271     public String getModelEncoding()
272     {
273         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         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         if ( this.poweredBy == null )
294         {
295             this.poweredBy = new java.util.ArrayList<Logo>();
296         }
297 
298         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         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         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         return this.version;
329     } //-- Version getVersion()
330 
331     /**
332      * Method hashCode.
333      * 
334      * @return int
335      */
336     public int hashCode()
337     {
338         int result = 17;
339 
340         result = 37 * result + ( name != null ? name.hashCode() : 0 );
341         result = 37 * result + ( bannerLeft != null ? bannerLeft.hashCode() : 0 );
342         result = 37 * result + ( bannerRight != null ? bannerRight.hashCode() : 0 );
343         result = 37 * result + ( googleAnalyticsAccountId != null ? googleAnalyticsAccountId.hashCode() : 0 );
344         result = 37 * result + ( publishDate != null ? publishDate.hashCode() : 0 );
345         result = 37 * result + ( version != null ? version.hashCode() : 0 );
346         result = 37 * result + ( poweredBy != null ? poweredBy.hashCode() : 0 );
347         result = 37 * result + ( skin != null ? skin.hashCode() : 0 );
348         result = 37 * result + ( body != null ? body.hashCode() : 0 );
349         result = 37 * result + ( custom != null ? custom.hashCode() : 0 );
350 
351         return result;
352     } //-- int hashCode()
353 
354     /**
355      * Method removePoweredBy.
356      * 
357      * @param logo
358      */
359     public void removePoweredBy( Logo logo )
360     {
361         getPoweredBy().remove( logo );
362     } //-- 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         this.bannerLeft = bannerLeft;
372     } //-- 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         this.bannerRight = bannerRight;
382     } //-- 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         this.body = body;
392     } //-- 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         this.custom = custom;
403     } //-- 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         this.googleAnalyticsAccountId = googleAnalyticsAccountId;
413     } //-- 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         this.lastModified = lastModified;
424     } //-- void setLastModified( long )
425 
426     /**
427      * Set the modelEncoding field.
428      * 
429      * @param modelEncoding
430      */
431     public void setModelEncoding( String modelEncoding )
432     {
433         this.modelEncoding = modelEncoding;
434     } //-- 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         this.name = name;
444     } //-- 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         this.poweredBy = poweredBy;
454     } //-- 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         this.publishDate = publishDate;
464     } //-- 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         this.skin = skin;
474     } //-- 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         this.version = version;
484     } //-- void setVersion( Version )
485 
486     /**
487      * Method toString.
488      * 
489      * @return String
490      */
491     public java.lang.String toString()
492     {
493         StringBuilder buf = new StringBuilder( 128 );
494 
495         buf.append( "name = '" );
496         buf.append( getName() );
497         buf.append( "'" );
498         buf.append( "\n" ); 
499         buf.append( "bannerLeft = '" );
500         buf.append( getBannerLeft() );
501         buf.append( "'" );
502         buf.append( "\n" ); 
503         buf.append( "bannerRight = '" );
504         buf.append( getBannerRight() );
505         buf.append( "'" );
506         buf.append( "\n" ); 
507         buf.append( "googleAnalyticsAccountId = '" );
508         buf.append( getGoogleAnalyticsAccountId() );
509         buf.append( "'" );
510         buf.append( "\n" ); 
511         buf.append( "publishDate = '" );
512         buf.append( getPublishDate() );
513         buf.append( "'" );
514         buf.append( "\n" ); 
515         buf.append( "version = '" );
516         buf.append( getVersion() );
517         buf.append( "'" );
518         buf.append( "\n" ); 
519         buf.append( "poweredBy = '" );
520         buf.append( getPoweredBy() );
521         buf.append( "'" );
522         buf.append( "\n" ); 
523         buf.append( "skin = '" );
524         buf.append( getSkin() );
525         buf.append( "'" );
526         buf.append( "\n" ); 
527         buf.append( "body = '" );
528         buf.append( getBody() );
529         buf.append( "'" );
530         buf.append( "\n" ); 
531         buf.append( "custom = '" );
532         buf.append( getCustom() );
533         buf.append( "'" );
534 
535         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         if ( menusByRef == null )
549         {
550             menusByRef = new java.util.HashMap<String, Menu>();
551 
552             if ( body != null )
553             {
554                 for ( Menu menu : body.getMenus() )
555                 {
556                     if ( menu.getRef() != null )
557                     {
558                         menusByRef.put( menu.getRef(), menu );
559                     }
560                 }
561             }
562         }
563         return menusByRef.get( key );
564     }
565 
566     /**
567      * @param key not null
568      */
569     public void removeMenuRef( String key )
570     {
571         if ( body != null )
572         {
573             for ( java.util.Iterator<Menu> i = body.getMenus().iterator(); i.hasNext(); )
574             {
575                 Menu menu = i.next();
576                 if ( key.equals( menu.getRef() ) )
577                 {
578                     i.remove();
579                 }
580             }
581         }
582     }
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         if ( body != null && body.getMenus() != null )
591         {
592             menus = body.getMenus();
593         }
594         else
595         {
596             menus = java.util.Collections.emptyList();
597         }
598         return menus;
599     }
600             
601           
602 }