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   * The main content decoration.
12   * 
13   * @version $Revision$ $Date$
14   */
15  @SuppressWarnings( "all" )
16  public class Body
17      implements java.io.Serializable, java.lang.Cloneable
18  {
19  
20        //--------------------------/
21       //- Class/Member Variables -/
22      //--------------------------/
23  
24      /**
25       * Additional content (like Javascript) to include in the HEAD
26       * block of the generated pages.
27       */
28      private Object head;
29  
30      /**
31       * Field links.
32       */
33      private java.util.List<LinkItem> links;
34  
35      /**
36       * Field breadcrumbs.
37       */
38      private java.util.List<LinkItem> breadcrumbs;
39  
40      /**
41       * Field menus.
42       */
43      private java.util.List<Menu> menus;
44  
45      /**
46       * If present, the contained text will be used instead of the
47       * generated copyright text.
48       */
49      private Object footer;
50  
51  
52        //-----------/
53       //- Methods -/
54      //-----------/
55  
56      /**
57       * Method addBreadcrumb.
58       * 
59       * @param linkItem
60       */
61      public void addBreadcrumb( LinkItem linkItem )
62      {
63          getBreadcrumbs().add( linkItem );
64      } //-- void addBreadcrumb( LinkItem )
65  
66      /**
67       * Method addLink.
68       * 
69       * @param linkItem
70       */
71      public void addLink( LinkItem linkItem )
72      {
73          getLinks().add( linkItem );
74      } //-- void addLink( LinkItem )
75  
76      /**
77       * Method addMenu.
78       * 
79       * @param menu
80       */
81      public void addMenu( Menu menu )
82      {
83          getMenus().add( menu );
84      } //-- void addMenu( Menu )
85  
86      /**
87       * Method clone.
88       * 
89       * @return Body
90       */
91      public Body clone()
92      {
93          try
94          {
95              Body copy = (Body) super.clone();
96  
97              if ( this.head != null )
98              {
99                  copy.head = new org.codehaus.plexus.util.xml.Xpp3Dom( (org.codehaus.plexus.util.xml.Xpp3Dom) this.head );
100             }
101 
102             if ( this.links != null )
103             {
104                 copy.links = new java.util.ArrayList<LinkItem>();
105                 for ( LinkItem item : this.links )
106                 {
107                     copy.links.add( ( (LinkItem) item).clone() );
108                 }
109             }
110 
111             if ( this.breadcrumbs != null )
112             {
113                 copy.breadcrumbs = new java.util.ArrayList<LinkItem>();
114                 for ( LinkItem item : this.breadcrumbs )
115                 {
116                     copy.breadcrumbs.add( ( (LinkItem) item).clone() );
117                 }
118             }
119 
120             if ( this.menus != null )
121             {
122                 copy.menus = new java.util.ArrayList<Menu>();
123                 for ( Menu item : this.menus )
124                 {
125                     copy.menus.add( ( (Menu) item).clone() );
126                 }
127             }
128 
129             if ( this.footer != null )
130             {
131                 copy.footer = new org.codehaus.plexus.util.xml.Xpp3Dom( (org.codehaus.plexus.util.xml.Xpp3Dom) this.footer );
132             }
133 
134             return copy;
135         }
136         catch ( java.lang.Exception ex )
137         {
138             throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
139                 + " does not support clone()" ).initCause( ex );
140         }
141     } //-- Body clone()
142 
143     /**
144      * Method equals.
145      * 
146      * @param other
147      * @return boolean
148      */
149     public boolean equals( Object other )
150     {
151         if ( this == other )
152         {
153             return true;
154         }
155 
156         if ( !( other instanceof Body ) )
157         {
158             return false;
159         }
160 
161         Body that = (Body) other;
162         boolean result = true;
163 
164         result = result && ( getHead() == null ? that.getHead() == null : getHead().equals( that.getHead() ) );
165         result = result && ( getLinks() == null ? that.getLinks() == null : getLinks().equals( that.getLinks() ) );
166         result = result && ( getBreadcrumbs() == null ? that.getBreadcrumbs() == null : getBreadcrumbs().equals( that.getBreadcrumbs() ) );
167         result = result && ( getMenus() == null ? that.getMenus() == null : getMenus().equals( that.getMenus() ) );
168         result = result && ( getFooter() == null ? that.getFooter() == null : getFooter().equals( that.getFooter() ) );
169 
170         return result;
171     } //-- boolean equals( Object )
172 
173     /**
174      * Method getBreadcrumbs.
175      * 
176      * @return List
177      */
178     public java.util.List<LinkItem> getBreadcrumbs()
179     {
180         if ( this.breadcrumbs == null )
181         {
182             this.breadcrumbs = new java.util.ArrayList<LinkItem>();
183         }
184 
185         return this.breadcrumbs;
186     } //-- java.util.List<LinkItem> getBreadcrumbs()
187 
188     /**
189      * Get if present, the contained text will be used instead of
190      * the generated copyright text.
191      * 
192      * @return Object
193      */
194     public Object getFooter()
195     {
196         return this.footer;
197     } //-- Object getFooter()
198 
199     /**
200      * Get additional content (like Javascript) to include in the
201      * HEAD block of the generated pages.
202      * 
203      * @return Object
204      */
205     public Object getHead()
206     {
207         return this.head;
208     } //-- Object getHead()
209 
210     /**
211      * Method getLinks.
212      * 
213      * @return List
214      */
215     public java.util.List<LinkItem> getLinks()
216     {
217         if ( this.links == null )
218         {
219             this.links = new java.util.ArrayList<LinkItem>();
220         }
221 
222         return this.links;
223     } //-- java.util.List<LinkItem> getLinks()
224 
225     /**
226      * Method getMenus.
227      * 
228      * @return List
229      */
230     public java.util.List<Menu> getMenus()
231     {
232         if ( this.menus == null )
233         {
234             this.menus = new java.util.ArrayList<Menu>();
235         }
236 
237         return this.menus;
238     } //-- java.util.List<Menu> getMenus()
239 
240     /**
241      * Method hashCode.
242      * 
243      * @return int
244      */
245     public int hashCode()
246     {
247         int result = 17;
248 
249         result = 37 * result + ( head != null ? head.hashCode() : 0 );
250         result = 37 * result + ( links != null ? links.hashCode() : 0 );
251         result = 37 * result + ( breadcrumbs != null ? breadcrumbs.hashCode() : 0 );
252         result = 37 * result + ( menus != null ? menus.hashCode() : 0 );
253         result = 37 * result + ( footer != null ? footer.hashCode() : 0 );
254 
255         return result;
256     } //-- int hashCode()
257 
258     /**
259      * Method removeBreadcrumb.
260      * 
261      * @param linkItem
262      */
263     public void removeBreadcrumb( LinkItem linkItem )
264     {
265         getBreadcrumbs().remove( linkItem );
266     } //-- void removeBreadcrumb( LinkItem )
267 
268     /**
269      * Method removeLink.
270      * 
271      * @param linkItem
272      */
273     public void removeLink( LinkItem linkItem )
274     {
275         getLinks().remove( linkItem );
276     } //-- void removeLink( LinkItem )
277 
278     /**
279      * Method removeMenu.
280      * 
281      * @param menu
282      */
283     public void removeMenu( Menu menu )
284     {
285         getMenus().remove( menu );
286     } //-- void removeMenu( Menu )
287 
288     /**
289      * Set a list of breadcrumbs to display in the navigation.
290      * 
291      * @param breadcrumbs
292      */
293     public void setBreadcrumbs( java.util.List<LinkItem> breadcrumbs )
294     {
295         this.breadcrumbs = breadcrumbs;
296     } //-- void setBreadcrumbs( java.util.List )
297 
298     /**
299      * Set if present, the contained text will be used instead of
300      * the generated copyright text.
301      * 
302      * @param footer
303      */
304     public void setFooter( Object footer )
305     {
306         this.footer = footer;
307     } //-- void setFooter( Object )
308 
309     /**
310      * Set additional content (like Javascript) to include in the
311      * HEAD block of the generated pages.
312      * 
313      * @param head
314      */
315     public void setHead( Object head )
316     {
317         this.head = head;
318     } //-- void setHead( Object )
319 
320     /**
321      * Set a list of links to display in the navigation.
322      * 
323      * @param links
324      */
325     public void setLinks( java.util.List<LinkItem> links )
326     {
327         this.links = links;
328     } //-- void setLinks( java.util.List )
329 
330     /**
331      * Set a list of menus to include in the navigation.
332      * 
333      * @param menus
334      */
335     public void setMenus( java.util.List<Menu> menus )
336     {
337         this.menus = menus;
338     } //-- void setMenus( java.util.List )
339 
340     /**
341      * Method toString.
342      * 
343      * @return String
344      */
345     public java.lang.String toString()
346     {
347         StringBuilder buf = new StringBuilder( 128 );
348 
349         buf.append( "head = '" );
350         buf.append( getHead() );
351         buf.append( "'" );
352         buf.append( "\n" ); 
353         buf.append( "links = '" );
354         buf.append( getLinks() );
355         buf.append( "'" );
356         buf.append( "\n" ); 
357         buf.append( "breadcrumbs = '" );
358         buf.append( getBreadcrumbs() );
359         buf.append( "'" );
360         buf.append( "\n" ); 
361         buf.append( "menus = '" );
362         buf.append( getMenus() );
363         buf.append( "'" );
364         buf.append( "\n" ); 
365         buf.append( "footer = '" );
366         buf.append( getFooter() );
367         buf.append( "'" );
368 
369         return buf.toString();
370     } //-- java.lang.String toString()
371 
372 }