View Javadoc

1   /*
2    =================== DO NOT EDIT THIS FILE ====================
3    Generated by Modello 1.4.1 on 2013-04-24 00:05:29,
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       * Your Google AdSense client id.
46       */
47      private String googleAdSenseClient;
48  
49      /**
50       * Your Google AdSense slot id.
51       */
52      private String googleAdSenseSlot;
53  
54      /**
55       * The id for your Google Analytics account.
56       */
57      private String googleAnalyticsAccountId;
58  
59      /**
60       * Modify the date published display properties.
61       */
62      private PublishDate publishDate;
63  
64      /**
65       * Modify the version published display properties.
66       */
67      private Version version;
68  
69      /**
70       * Field poweredBy.
71       */
72      private java.util.List<Logo> poweredBy;
73  
74      /**
75       * The artifact containing the skin for the site.
76       */
77      private Skin skin;
78  
79      /**
80       * The main site content decoration.
81       */
82      private Body body;
83  
84      /**
85       * 
86       *             Custom configuration for use with customized
87       * Velocity templates. Data from this field are
88       *             accessible in Velocity template from
89       * <code>$decoration.custom</code> variable as DOM content.
90       *             Example: <code>$decoration.custom.getChild(
91       * 'customElement' ).getValue()</code>
92       *           
93       */
94      private Object custom;
95  
96      /**
97       * Timestamp of the last modification of this decoration model.
98       */
99      private long lastModified = 0L;
100 
101     /**
102      * Field modelEncoding.
103      */
104     private String modelEncoding = "UTF-8";
105 
106 
107       //-----------/
108      //- Methods -/
109     //-----------/
110 
111     /**
112      * Method addPoweredBy.
113      * 
114      * @param logo
115      */
116     public void addPoweredBy( Logo logo )
117     {
118         getPoweredBy().add( logo );
119     } //-- void addPoweredBy( Logo )
120 
121     /**
122      * Method clone.
123      * 
124      * @return DecorationModel
125      */
126     public DecorationModel clone()
127     {
128         try
129         {
130             DecorationModel copy = (DecorationModel) super.clone();
131 
132             if ( this.bannerLeft != null )
133             {
134                 copy.bannerLeft = (Banner) this.bannerLeft.clone();
135             }
136 
137             if ( this.bannerRight != null )
138             {
139                 copy.bannerRight = (Banner) this.bannerRight.clone();
140             }
141 
142             if ( this.publishDate != null )
143             {
144                 copy.publishDate = (PublishDate) this.publishDate.clone();
145             }
146 
147             if ( this.version != null )
148             {
149                 copy.version = (Version) this.version.clone();
150             }
151 
152             if ( this.poweredBy != null )
153             {
154                 copy.poweredBy = new java.util.ArrayList<Logo>();
155                 for ( Logo item : this.poweredBy )
156                 {
157                     copy.poweredBy.add( ( (Logo) item).clone() );
158                 }
159             }
160 
161             if ( this.skin != null )
162             {
163                 copy.skin = (Skin) this.skin.clone();
164             }
165 
166             if ( this.body != null )
167             {
168                 copy.body = (Body) this.body.clone();
169             }
170 
171             if ( this.custom != null )
172             {
173                 copy.custom = new org.codehaus.plexus.util.xml.Xpp3Dom( (org.codehaus.plexus.util.xml.Xpp3Dom) this.custom );
174             }
175 
176             return copy;
177         }
178         catch ( java.lang.Exception ex )
179         {
180             throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
181                 + " does not support clone()" ).initCause( ex );
182         }
183     } //-- DecorationModel clone()
184 
185     /**
186      * Method equals.
187      * 
188      * @param other
189      * @return boolean
190      */
191     public boolean equals( Object other )
192     {
193         if ( this == other )
194         {
195             return true;
196         }
197 
198         if ( !( other instanceof DecorationModel ) )
199         {
200             return false;
201         }
202 
203         DecorationModel that = (DecorationModel) other;
204         boolean result = true;
205 
206         result = result && ( getName() == null ? that.getName() == null : getName().equals( that.getName() ) );
207         result = result && ( getBannerLeft() == null ? that.getBannerLeft() == null : getBannerLeft().equals( that.getBannerLeft() ) );
208         result = result && ( getBannerRight() == null ? that.getBannerRight() == null : getBannerRight().equals( that.getBannerRight() ) );
209         result = result && ( getGoogleAdSenseClient() == null ? that.getGoogleAdSenseClient() == null : getGoogleAdSenseClient().equals( that.getGoogleAdSenseClient() ) );
210         result = result && ( getGoogleAdSenseSlot() == null ? that.getGoogleAdSenseSlot() == null : getGoogleAdSenseSlot().equals( that.getGoogleAdSenseSlot() ) );
211         result = result && ( getGoogleAnalyticsAccountId() == null ? that.getGoogleAnalyticsAccountId() == null : getGoogleAnalyticsAccountId().equals( that.getGoogleAnalyticsAccountId() ) );
212         result = result && ( getPublishDate() == null ? that.getPublishDate() == null : getPublishDate().equals( that.getPublishDate() ) );
213         result = result && ( getVersion() == null ? that.getVersion() == null : getVersion().equals( that.getVersion() ) );
214         result = result && ( getPoweredBy() == null ? that.getPoweredBy() == null : getPoweredBy().equals( that.getPoweredBy() ) );
215         result = result && ( getSkin() == null ? that.getSkin() == null : getSkin().equals( that.getSkin() ) );
216         result = result && ( getBody() == null ? that.getBody() == null : getBody().equals( that.getBody() ) );
217         result = result && ( getCustom() == null ? that.getCustom() == null : getCustom().equals( that.getCustom() ) );
218 
219         return result;
220     } //-- boolean equals( Object )
221 
222     /**
223      * Get banner logo on the masthead of the site to the left.
224      * 
225      * @return Banner
226      */
227     public Banner getBannerLeft()
228     {
229         return this.bannerLeft;
230     } //-- Banner getBannerLeft()
231 
232     /**
233      * Get banner logo on the masthead of the site to the right.
234      * 
235      * @return Banner
236      */
237     public Banner getBannerRight()
238     {
239         return this.bannerRight;
240     } //-- Banner getBannerRight()
241 
242     /**
243      * Get the main site content decoration.
244      * 
245      * @return Body
246      */
247     public Body getBody()
248     {
249         return this.body;
250     } //-- Body getBody()
251 
252     /**
253      * Get custom configuration for use with customized Velocity
254      * templates. Data from this field are
255      *             accessible in Velocity template from
256      * <code>$decoration.custom</code> variable as DOM content.
257      *             Example: <code>$decoration.custom.getChild(
258      * 'customElement' ).getValue()</code>
259      * 
260      * @return Object
261      */
262     public Object getCustom()
263     {
264         return this.custom;
265     } //-- Object getCustom()
266 
267     /**
268      * Get your Google AdSense client id.
269      * 
270      * @return String
271      */
272     public String getGoogleAdSenseClient()
273     {
274         return this.googleAdSenseClient;
275     } //-- String getGoogleAdSenseClient()
276 
277     /**
278      * Get your Google AdSense slot id.
279      * 
280      * @return String
281      */
282     public String getGoogleAdSenseSlot()
283     {
284         return this.googleAdSenseSlot;
285     } //-- String getGoogleAdSenseSlot()
286 
287     /**
288      * Get the id for your Google Analytics account.
289      * 
290      * @return String
291      */
292     public String getGoogleAnalyticsAccountId()
293     {
294         return this.googleAnalyticsAccountId;
295     } //-- String getGoogleAnalyticsAccountId()
296 
297     /**
298      * Get timestamp of the last modification of this decoration
299      * model.
300      * 
301      * @return long
302      */
303     public long getLastModified()
304     {
305         return this.lastModified;
306     } //-- long getLastModified()
307 
308     /**
309      * Get the modelEncoding field.
310      * 
311      * @return String
312      */
313     public String getModelEncoding()
314     {
315         return this.modelEncoding;
316     } //-- String getModelEncoding()
317 
318     /**
319      * Get the full name of the project.
320      * 
321      * @return String
322      */
323     public String getName()
324     {
325         return this.name;
326     } //-- String getName()
327 
328     /**
329      * Method getPoweredBy.
330      * 
331      * @return List
332      */
333     public java.util.List<Logo> getPoweredBy()
334     {
335         if ( this.poweredBy == null )
336         {
337             this.poweredBy = new java.util.ArrayList<Logo>();
338         }
339 
340         return this.poweredBy;
341     } //-- java.util.List<Logo> getPoweredBy()
342 
343     /**
344      * Get the artifact containing the skin for the site.
345      * 
346      * @return Skin
347      */
348     public Skin getSkin()
349     {
350         return this.skin;
351     } //-- Skin getSkin()
352 
353     /**
354      * Method hashCode.
355      * 
356      * @return int
357      */
358     public int hashCode()
359     {
360         int result = 17;
361 
362         result = 37 * result + ( name != null ? name.hashCode() : 0 );
363         result = 37 * result + ( bannerLeft != null ? bannerLeft.hashCode() : 0 );
364         result = 37 * result + ( bannerRight != null ? bannerRight.hashCode() : 0 );
365         result = 37 * result + ( googleAdSenseClient != null ? googleAdSenseClient.hashCode() : 0 );
366         result = 37 * result + ( googleAdSenseSlot != null ? googleAdSenseSlot.hashCode() : 0 );
367         result = 37 * result + ( googleAnalyticsAccountId != null ? googleAnalyticsAccountId.hashCode() : 0 );
368         result = 37 * result + ( publishDate != null ? publishDate.hashCode() : 0 );
369         result = 37 * result + ( version != null ? version.hashCode() : 0 );
370         result = 37 * result + ( poweredBy != null ? poweredBy.hashCode() : 0 );
371         result = 37 * result + ( skin != null ? skin.hashCode() : 0 );
372         result = 37 * result + ( body != null ? body.hashCode() : 0 );
373         result = 37 * result + ( custom != null ? custom.hashCode() : 0 );
374 
375         return result;
376     } //-- int hashCode()
377 
378     /**
379      * Method removePoweredBy.
380      * 
381      * @param logo
382      */
383     public void removePoweredBy( Logo logo )
384     {
385         getPoweredBy().remove( logo );
386     } //-- void removePoweredBy( Logo )
387 
388     /**
389      * Set banner logo on the masthead of the site to the left.
390      * 
391      * @param bannerLeft
392      */
393     public void setBannerLeft( Banner bannerLeft )
394     {
395         this.bannerLeft = bannerLeft;
396     } //-- void setBannerLeft( Banner )
397 
398     /**
399      * Set banner logo on the masthead of the site to the right.
400      * 
401      * @param bannerRight
402      */
403     public void setBannerRight( Banner bannerRight )
404     {
405         this.bannerRight = bannerRight;
406     } //-- void setBannerRight( Banner )
407 
408     /**
409      * Set the main site content decoration.
410      * 
411      * @param body
412      */
413     public void setBody( Body body )
414     {
415         this.body = body;
416     } //-- void setBody( Body )
417 
418     /**
419      * Set custom configuration for use with customized Velocity
420      * templates. Data from this field are
421      *             accessible in Velocity template from
422      * <code>$decoration.custom</code> variable as DOM content.
423      *             Example: <code>$decoration.custom.getChild(
424      * 'customElement' ).getValue()</code>
425      * 
426      * @param custom
427      */
428     public void setCustom( Object custom )
429     {
430         this.custom = custom;
431     } //-- void setCustom( Object )
432 
433     /**
434      * Set your Google AdSense client id.
435      * 
436      * @param googleAdSenseClient
437      */
438     public void setGoogleAdSenseClient( String googleAdSenseClient )
439     {
440         this.googleAdSenseClient = googleAdSenseClient;
441     } //-- void setGoogleAdSenseClient( String )
442 
443     /**
444      * Set your Google AdSense slot id.
445      * 
446      * @param googleAdSenseSlot
447      */
448     public void setGoogleAdSenseSlot( String googleAdSenseSlot )
449     {
450         this.googleAdSenseSlot = googleAdSenseSlot;
451     } //-- void setGoogleAdSenseSlot( String )
452 
453     /**
454      * Set the id for your Google Analytics account.
455      * 
456      * @param googleAnalyticsAccountId
457      */
458     public void setGoogleAnalyticsAccountId( String googleAnalyticsAccountId )
459     {
460         this.googleAnalyticsAccountId = googleAnalyticsAccountId;
461     } //-- void setGoogleAnalyticsAccountId( String )
462 
463     /**
464      * Set timestamp of the last modification of this decoration
465      * model.
466      * 
467      * @param lastModified
468      */
469     public void setLastModified( long lastModified )
470     {
471         this.lastModified = lastModified;
472     } //-- void setLastModified( long )
473 
474     /**
475      * Set the modelEncoding field.
476      * 
477      * @param modelEncoding
478      */
479     public void setModelEncoding( String modelEncoding )
480     {
481         this.modelEncoding = modelEncoding;
482     } //-- void setModelEncoding( String )
483 
484     /**
485      * Set the full name of the project.
486      * 
487      * @param name
488      */
489     public void setName( String name )
490     {
491         this.name = name;
492     } //-- void setName( String )
493 
494     /**
495      * Set powered by logos list.
496      * 
497      * @param poweredBy
498      */
499     public void setPoweredBy( java.util.List<Logo> poweredBy )
500     {
501         this.poweredBy = poweredBy;
502     } //-- void setPoweredBy( java.util.List )
503 
504     /**
505      * Set modify the date published display properties.
506      * 
507      * @param publishDate
508      */
509     public void setPublishDate( PublishDate publishDate )
510     {
511         this.publishDate = publishDate;
512     } //-- void setPublishDate( PublishDate )
513 
514     /**
515      * Set the artifact containing the skin for the site.
516      * 
517      * @param skin
518      */
519     public void setSkin( Skin skin )
520     {
521         this.skin = skin;
522     } //-- void setSkin( Skin )
523 
524     /**
525      * Set modify the version published display properties.
526      * 
527      * @param version
528      */
529     public void setVersion( Version version )
530     {
531         this.version = version;
532     } //-- void setVersion( Version )
533 
534     /**
535      * Method toString.
536      * 
537      * @return String
538      */
539     public java.lang.String toString()
540     {
541         StringBuilder buf = new StringBuilder( 128 );
542 
543         buf.append( "name = '" );
544         buf.append( getName() );
545         buf.append( "'" );
546         buf.append( "\n" ); 
547         buf.append( "bannerLeft = '" );
548         buf.append( getBannerLeft() );
549         buf.append( "'" );
550         buf.append( "\n" ); 
551         buf.append( "bannerRight = '" );
552         buf.append( getBannerRight() );
553         buf.append( "'" );
554         buf.append( "\n" ); 
555         buf.append( "googleAdSenseClient = '" );
556         buf.append( getGoogleAdSenseClient() );
557         buf.append( "'" );
558         buf.append( "\n" ); 
559         buf.append( "googleAdSenseSlot = '" );
560         buf.append( getGoogleAdSenseSlot() );
561         buf.append( "'" );
562         buf.append( "\n" ); 
563         buf.append( "googleAnalyticsAccountId = '" );
564         buf.append( getGoogleAnalyticsAccountId() );
565         buf.append( "'" );
566         buf.append( "\n" ); 
567         buf.append( "publishDate = '" );
568         buf.append( getPublishDate() );
569         buf.append( "'" );
570         buf.append( "\n" ); 
571         buf.append( "version = '" );
572         buf.append( getVersion() );
573         buf.append( "'" );
574         buf.append( "\n" ); 
575         buf.append( "poweredBy = '" );
576         buf.append( getPoweredBy() );
577         buf.append( "'" );
578         buf.append( "\n" ); 
579         buf.append( "skin = '" );
580         buf.append( getSkin() );
581         buf.append( "'" );
582         buf.append( "\n" ); 
583         buf.append( "body = '" );
584         buf.append( getBody() );
585         buf.append( "'" );
586         buf.append( "\n" ); 
587         buf.append( "custom = '" );
588         buf.append( getCustom() );
589         buf.append( "'" );
590 
591         return buf.toString();
592     } //-- java.lang.String toString()
593 
594     
595             
596 
597     public PublishDate getPublishDate()
598     {
599         if ( publishDate == null )
600             return new PublishDate();
601         else
602             return publishDate;
603     }
604 
605     public boolean isDefaultPublishDate()
606     {
607         return publishDate == null;
608     }
609 
610     public Version getVersion()
611     {
612         if ( version == null )
613             return new Version();
614         else
615             return version;
616     }
617 
618     public boolean isDefaultVersion()
619     {
620         return version == null;
621     }
622 
623     private java.util.Map<String, Menu> menusByRef;
624 
625     /**
626      * @param key not null
627      * @return the menu ref defined by the given key.
628      */
629     public Menu getMenuRef( String key )
630     {
631         if ( menusByRef == null )
632         {
633             menusByRef = new java.util.HashMap<String, Menu>();
634 
635             if ( body != null )
636             {
637                 for ( Menu menu : body.getMenus() )
638                 {
639                     if ( menu.getRef() != null )
640                     {
641                         menusByRef.put( menu.getRef(), menu );
642                     }
643                 }
644             }
645         }
646         return menusByRef.get( key );
647     }
648 
649     /**
650      * @param key not null
651      */
652     public void removeMenuRef( String key )
653     {
654         if ( body != null )
655         {
656             for ( java.util.Iterator<Menu> i = body.getMenus().iterator(); i.hasNext(); )
657             {
658                 Menu menu = i.next();
659                 if ( key.equals( menu.getRef() ) )
660                 {
661                     i.remove();
662                 }
663             }
664         }
665     }
666 
667     /**
668      * @return the menus list or EMPTY_LIST.
669      */
670     public java.util.List<Menu> getMenus()
671     {
672         java.util.List menus;
673         if ( body != null && body.getMenus() != null )
674         {
675             menus = body.getMenus();
676         }
677         else
678         {
679             menus = java.util.Collections.emptyList();
680         }
681         return menus;
682     }
683             
684           
685 }