View Javadoc

1   /*
2    =================== DO NOT EDIT THIS FILE ====================
3    Generated by Modello 1.4.1 on 2012-04-17 22:28:45,
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 modify the date published display properties.
345      * 
346      * @return PublishDate
347      */
348     public PublishDate getPublishDate()
349     {
350         return this.publishDate;
351     } //-- PublishDate getPublishDate()
352 
353     /**
354      * Get the artifact containing the skin for the site.
355      * 
356      * @return Skin
357      */
358     public Skin getSkin()
359     {
360         return this.skin;
361     } //-- Skin getSkin()
362 
363     /**
364      * Get modify the version published display properties.
365      * 
366      * @return Version
367      */
368     public Version getVersion()
369     {
370         return this.version;
371     } //-- Version getVersion()
372 
373     /**
374      * Method hashCode.
375      * 
376      * @return int
377      */
378     public int hashCode()
379     {
380         int result = 17;
381 
382         result = 37 * result + ( name != null ? name.hashCode() : 0 );
383         result = 37 * result + ( bannerLeft != null ? bannerLeft.hashCode() : 0 );
384         result = 37 * result + ( bannerRight != null ? bannerRight.hashCode() : 0 );
385         result = 37 * result + ( googleAdSenseClient != null ? googleAdSenseClient.hashCode() : 0 );
386         result = 37 * result + ( googleAdSenseSlot != null ? googleAdSenseSlot.hashCode() : 0 );
387         result = 37 * result + ( googleAnalyticsAccountId != null ? googleAnalyticsAccountId.hashCode() : 0 );
388         result = 37 * result + ( publishDate != null ? publishDate.hashCode() : 0 );
389         result = 37 * result + ( version != null ? version.hashCode() : 0 );
390         result = 37 * result + ( poweredBy != null ? poweredBy.hashCode() : 0 );
391         result = 37 * result + ( skin != null ? skin.hashCode() : 0 );
392         result = 37 * result + ( body != null ? body.hashCode() : 0 );
393         result = 37 * result + ( custom != null ? custom.hashCode() : 0 );
394 
395         return result;
396     } //-- int hashCode()
397 
398     /**
399      * Method removePoweredBy.
400      * 
401      * @param logo
402      */
403     public void removePoweredBy( Logo logo )
404     {
405         getPoweredBy().remove( logo );
406     } //-- void removePoweredBy( Logo )
407 
408     /**
409      * Set banner logo on the masthead of the site to the left.
410      * 
411      * @param bannerLeft
412      */
413     public void setBannerLeft( Banner bannerLeft )
414     {
415         this.bannerLeft = bannerLeft;
416     } //-- void setBannerLeft( Banner )
417 
418     /**
419      * Set banner logo on the masthead of the site to the right.
420      * 
421      * @param bannerRight
422      */
423     public void setBannerRight( Banner bannerRight )
424     {
425         this.bannerRight = bannerRight;
426     } //-- void setBannerRight( Banner )
427 
428     /**
429      * Set the main site content decoration.
430      * 
431      * @param body
432      */
433     public void setBody( Body body )
434     {
435         this.body = body;
436     } //-- void setBody( Body )
437 
438     /**
439      * Set custom configuration for use with customized Velocity
440      * templates. Data from this field are
441      *             accessible in Velocity template from
442      * <code>$decoration.custom</code> variable as DOM content.
443      *             Example: <code>$decoration.custom.getChild(
444      * 'customElement' ).getValue()</code>
445      * 
446      * @param custom
447      */
448     public void setCustom( Object custom )
449     {
450         this.custom = custom;
451     } //-- void setCustom( Object )
452 
453     /**
454      * Set your Google AdSense client id.
455      * 
456      * @param googleAdSenseClient
457      */
458     public void setGoogleAdSenseClient( String googleAdSenseClient )
459     {
460         this.googleAdSenseClient = googleAdSenseClient;
461     } //-- void setGoogleAdSenseClient( String )
462 
463     /**
464      * Set your Google AdSense slot id.
465      * 
466      * @param googleAdSenseSlot
467      */
468     public void setGoogleAdSenseSlot( String googleAdSenseSlot )
469     {
470         this.googleAdSenseSlot = googleAdSenseSlot;
471     } //-- void setGoogleAdSenseSlot( String )
472 
473     /**
474      * Set the id for your Google Analytics account.
475      * 
476      * @param googleAnalyticsAccountId
477      */
478     public void setGoogleAnalyticsAccountId( String googleAnalyticsAccountId )
479     {
480         this.googleAnalyticsAccountId = googleAnalyticsAccountId;
481     } //-- void setGoogleAnalyticsAccountId( String )
482 
483     /**
484      * Set timestamp of the last modification of this decoration
485      * model.
486      * 
487      * @param lastModified
488      */
489     public void setLastModified( long lastModified )
490     {
491         this.lastModified = lastModified;
492     } //-- void setLastModified( long )
493 
494     /**
495      * Set the modelEncoding field.
496      * 
497      * @param modelEncoding
498      */
499     public void setModelEncoding( String modelEncoding )
500     {
501         this.modelEncoding = modelEncoding;
502     } //-- void setModelEncoding( String )
503 
504     /**
505      * Set the full name of the project.
506      * 
507      * @param name
508      */
509     public void setName( String name )
510     {
511         this.name = name;
512     } //-- void setName( String )
513 
514     /**
515      * Set powered by logos list.
516      * 
517      * @param poweredBy
518      */
519     public void setPoweredBy( java.util.List<Logo> poweredBy )
520     {
521         this.poweredBy = poweredBy;
522     } //-- void setPoweredBy( java.util.List )
523 
524     /**
525      * Set modify the date published display properties.
526      * 
527      * @param publishDate
528      */
529     public void setPublishDate( PublishDate publishDate )
530     {
531         this.publishDate = publishDate;
532     } //-- void setPublishDate( PublishDate )
533 
534     /**
535      * Set the artifact containing the skin for the site.
536      * 
537      * @param skin
538      */
539     public void setSkin( Skin skin )
540     {
541         this.skin = skin;
542     } //-- void setSkin( Skin )
543 
544     /**
545      * Set modify the version published display properties.
546      * 
547      * @param version
548      */
549     public void setVersion( Version version )
550     {
551         this.version = version;
552     } //-- void setVersion( Version )
553 
554     /**
555      * Method toString.
556      * 
557      * @return String
558      */
559     public java.lang.String toString()
560     {
561         StringBuilder buf = new StringBuilder( 128 );
562 
563         buf.append( "name = '" );
564         buf.append( getName() );
565         buf.append( "'" );
566         buf.append( "\n" ); 
567         buf.append( "bannerLeft = '" );
568         buf.append( getBannerLeft() );
569         buf.append( "'" );
570         buf.append( "\n" ); 
571         buf.append( "bannerRight = '" );
572         buf.append( getBannerRight() );
573         buf.append( "'" );
574         buf.append( "\n" ); 
575         buf.append( "googleAdSenseClient = '" );
576         buf.append( getGoogleAdSenseClient() );
577         buf.append( "'" );
578         buf.append( "\n" ); 
579         buf.append( "googleAdSenseSlot = '" );
580         buf.append( getGoogleAdSenseSlot() );
581         buf.append( "'" );
582         buf.append( "\n" ); 
583         buf.append( "googleAnalyticsAccountId = '" );
584         buf.append( getGoogleAnalyticsAccountId() );
585         buf.append( "'" );
586         buf.append( "\n" ); 
587         buf.append( "publishDate = '" );
588         buf.append( getPublishDate() );
589         buf.append( "'" );
590         buf.append( "\n" ); 
591         buf.append( "version = '" );
592         buf.append( getVersion() );
593         buf.append( "'" );
594         buf.append( "\n" ); 
595         buf.append( "poweredBy = '" );
596         buf.append( getPoweredBy() );
597         buf.append( "'" );
598         buf.append( "\n" ); 
599         buf.append( "skin = '" );
600         buf.append( getSkin() );
601         buf.append( "'" );
602         buf.append( "\n" ); 
603         buf.append( "body = '" );
604         buf.append( getBody() );
605         buf.append( "'" );
606         buf.append( "\n" ); 
607         buf.append( "custom = '" );
608         buf.append( getCustom() );
609         buf.append( "'" );
610 
611         return buf.toString();
612     } //-- java.lang.String toString()
613 
614     
615             
616     private java.util.Map<String, Menu> menusByRef;
617 
618     /**
619      * @param key not null
620      * @return the menu ref defined by the given key.
621      */
622     public Menu getMenuRef( String key )
623     {
624         if ( menusByRef == null )
625         {
626             menusByRef = new java.util.HashMap<String, Menu>();
627 
628             if ( body != null )
629             {
630                 for ( Menu menu : body.getMenus() )
631                 {
632                     if ( menu.getRef() != null )
633                     {
634                         menusByRef.put( menu.getRef(), menu );
635                     }
636                 }
637             }
638         }
639         return menusByRef.get( key );
640     }
641 
642     /**
643      * @param key not null
644      */
645     public void removeMenuRef( String key )
646     {
647         if ( body != null )
648         {
649             for ( java.util.Iterator<Menu> i = body.getMenus().iterator(); i.hasNext(); )
650             {
651                 Menu menu = i.next();
652                 if ( key.equals( menu.getRef() ) )
653                 {
654                     i.remove();
655                 }
656             }
657         }
658     }
659 
660     /**
661      * @return the menus list or EMPTY_LIST.
662      */
663     public java.util.List<Menu> getMenus()
664     {
665         java.util.List menus;
666         if ( body != null && body.getMenus() != null )
667         {
668             menus = body.getMenus();
669         }
670         else
671         {
672             menus = java.util.Collections.emptyList();
673         }
674         return menus;
675     }
676             
677           
678 }