View Javadoc
1   // =================== DO NOT EDIT THIS FILE ====================
2   // Generated by Modello 2.1.2,
3   // any modifications will be overwritten.
4   // ==============================================================
5   
6   package org.apache.maven.doxia.site.decoration;
7   
8   /**
9    * A menu in the navigation.
10   * 
11   * @version $Revision$ $Date$
12   */
13  @SuppressWarnings( "all" )
14  public class Menu
15      implements java.io.Serializable, java.lang.Cloneable
16  {
17  
18        //--------------------------/
19       //- Class/Member Variables -/
20      //--------------------------/
21  
22      /**
23       * The name to display for the menu.
24       */
25      private String name;
26  
27      /**
28       * 
29       *             The way in which the menu is inherited. Can be
30       * one of : <code>top</code>, <code>bottom</code>.
31       *           
32       */
33      private String inherit;
34  
35      /**
36       * 
37       *             If this is a reference, setting to
38       * <code>true</code> means that it will be populated
39       *             in the project, whereas if it is
40       * <code>false</code>, it is populated in the parent and then
41       * inherited.
42       *           
43       */
44      private boolean inheritAsRef = false;
45  
46      /**
47       * 
48       *             Mark this menu as reference to a pre-defined
49       * menu: <code>reports</code>, <code>modules</code>
50       *             or <code>parent</code>. It will be populated at
51       * runtime with corresponding pre-defined content.
52       *           
53       */
54      private String ref;
55  
56      /**
57       * The source location of an menu image.
58       */
59      private String img;
60  
61      /**
62       * The alt description for the image.
63       */
64      private String alt;
65  
66      /**
67       * Where to place the image regarding the displayed name (left
68       * or right).
69       */
70      private String position = "left";
71  
72      /**
73       * The border to use for the menu image.
74       */
75      private String border;
76  
77      /**
78       * The width to use for the menu image.
79       */
80      private String width;
81  
82      /**
83       * The height to use for the menu image.
84       */
85      private String height;
86  
87      /**
88       * The title for the image.
89       */
90      private String title;
91  
92      /**
93       * Field items.
94       */
95      private java.util.List<MenuItem> items;
96  
97  
98        //-----------/
99       //- Methods -/
100     //-----------/
101 
102     /**
103      * Method addItem.
104      * 
105      * @param menuItem a menuItem object.
106      */
107     public void addItem( MenuItem menuItem )
108     {
109         getItems().add( menuItem );
110     } //-- void addItem( MenuItem )
111 
112     /**
113      * Method clone.
114      * 
115      * @return Menu
116      */
117     public Menu clone()
118     {
119         try
120         {
121             Menu copy = (Menu) super.clone();
122 
123             if ( this.items != null )
124             {
125                 copy.items = new java.util.ArrayList<MenuItem>();
126                 for ( MenuItem item : this.items )
127                 {
128                     copy.items.add( ( (MenuItem) item).clone() );
129                 }
130             }
131 
132             return copy;
133         }
134         catch ( java.lang.Exception ex )
135         {
136             throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
137                 + " does not support clone()" ).initCause( ex );
138         }
139     } //-- Menu clone()
140 
141     /**
142      * Method equals.
143      * 
144      * @param other a other object.
145      * @return boolean
146      */
147     public boolean equals( Object other )
148     {
149         if ( this == other )
150         {
151             return true;
152         }
153 
154         if ( !( other instanceof Menu ) )
155         {
156             return false;
157         }
158 
159         Menu that = (Menu) other;
160         boolean result = true;
161 
162         result = result && ( getName() == null ? that.getName() == null : getName().equals( that.getName() ) );
163         result = result && ( getInherit() == null ? that.getInherit() == null : getInherit().equals( that.getInherit() ) );
164         result = result && ( getRef() == null ? that.getRef() == null : getRef().equals( that.getRef() ) );
165         result = result && ( getImg() == null ? that.getImg() == null : getImg().equals( that.getImg() ) );
166         result = result && ( getAlt() == null ? that.getAlt() == null : getAlt().equals( that.getAlt() ) );
167         result = result && ( getPosition() == null ? that.getPosition() == null : getPosition().equals( that.getPosition() ) );
168         result = result && ( getBorder() == null ? that.getBorder() == null : getBorder().equals( that.getBorder() ) );
169         result = result && ( getWidth() == null ? that.getWidth() == null : getWidth().equals( that.getWidth() ) );
170         result = result && ( getHeight() == null ? that.getHeight() == null : getHeight().equals( that.getHeight() ) );
171         result = result && ( getTitle() == null ? that.getTitle() == null : getTitle().equals( that.getTitle() ) );
172         result = result && ( getItems() == null ? that.getItems() == null : getItems().equals( that.getItems() ) );
173 
174         return result;
175     } //-- boolean equals( Object )
176 
177     /**
178      * Get the alt description for the image.
179      * 
180      * @return String
181      */
182     public String getAlt()
183     {
184         return this.alt;
185     } //-- String getAlt()
186 
187     /**
188      * Get the border to use for the menu image.
189      * 
190      * @return String
191      */
192     public String getBorder()
193     {
194         return this.border;
195     } //-- String getBorder()
196 
197     /**
198      * Get the height to use for the menu image.
199      * 
200      * @return String
201      */
202     public String getHeight()
203     {
204         return this.height;
205     } //-- String getHeight()
206 
207     /**
208      * Get the source location of an menu image.
209      * 
210      * @return String
211      */
212     public String getImg()
213     {
214         return this.img;
215     } //-- String getImg()
216 
217     /**
218      * Get the way in which the menu is inherited. Can be one of :
219      * <code>top</code>, <code>bottom</code>.
220      * 
221      * @return String
222      */
223     public String getInherit()
224     {
225         return this.inherit;
226     } //-- String getInherit()
227 
228     /**
229      * Method getItems.
230      * 
231      * @return List
232      */
233     public java.util.List<MenuItem> getItems()
234     {
235         if ( this.items == null )
236         {
237             this.items = new java.util.ArrayList<MenuItem>();
238         }
239 
240         return this.items;
241     } //-- java.util.List<MenuItem> getItems()
242 
243     /**
244      * Get the name to display for the menu.
245      * 
246      * @return String
247      */
248     public String getName()
249     {
250         return this.name;
251     } //-- String getName()
252 
253     /**
254      * Get where to place the image regarding the displayed name
255      * (left or right).
256      * 
257      * @return String
258      */
259     public String getPosition()
260     {
261         return this.position;
262     } //-- String getPosition()
263 
264     /**
265      * Get mark this menu as reference to a pre-defined menu:
266      * <code>reports</code>, <code>modules</code>
267      *             or <code>parent</code>. It will be populated at
268      * runtime with corresponding pre-defined content.
269      * 
270      * @return String
271      */
272     public String getRef()
273     {
274         return this.ref;
275     } //-- String getRef()
276 
277     /**
278      * Get the title for the image.
279      * 
280      * @return String
281      */
282     public String getTitle()
283     {
284         return this.title;
285     } //-- String getTitle()
286 
287     /**
288      * Get the width to use for the menu image.
289      * 
290      * @return String
291      */
292     public String getWidth()
293     {
294         return this.width;
295     } //-- String getWidth()
296 
297     /**
298      * Method hashCode.
299      * 
300      * @return int
301      */
302     public int hashCode()
303     {
304         int result = 17;
305 
306         result = 37 * result + ( name != null ? name.hashCode() : 0 );
307         result = 37 * result + ( inherit != null ? inherit.hashCode() : 0 );
308         result = 37 * result + ( ref != null ? ref.hashCode() : 0 );
309         result = 37 * result + ( img != null ? img.hashCode() : 0 );
310         result = 37 * result + ( alt != null ? alt.hashCode() : 0 );
311         result = 37 * result + ( position != null ? position.hashCode() : 0 );
312         result = 37 * result + ( border != null ? border.hashCode() : 0 );
313         result = 37 * result + ( width != null ? width.hashCode() : 0 );
314         result = 37 * result + ( height != null ? height.hashCode() : 0 );
315         result = 37 * result + ( title != null ? title.hashCode() : 0 );
316         result = 37 * result + ( items != null ? items.hashCode() : 0 );
317 
318         return result;
319     } //-- int hashCode()
320 
321     /**
322      * Get if this is a reference, setting to <code>true</code>
323      * means that it will be populated
324      *             in the project, whereas if it is
325      * <code>false</code>, it is populated in the parent and then
326      * inherited.
327      * 
328      * @return boolean
329      */
330     public boolean isInheritAsRef()
331     {
332         return this.inheritAsRef;
333     } //-- boolean isInheritAsRef()
334 
335     /**
336      * Method removeItem.
337      * 
338      * @param menuItem a menuItem object.
339      */
340     public void removeItem( MenuItem menuItem )
341     {
342         getItems().remove( menuItem );
343     } //-- void removeItem( MenuItem )
344 
345     /**
346      * Set the alt description for the image.
347      * 
348      * @param alt a alt object.
349      */
350     public void setAlt( String alt )
351     {
352         this.alt = alt;
353     } //-- void setAlt( String )
354 
355     /**
356      * Set the border to use for the menu image.
357      * 
358      * @param border a border object.
359      */
360     public void setBorder( String border )
361     {
362         this.border = border;
363     } //-- void setBorder( String )
364 
365     /**
366      * Set the height to use for the menu image.
367      * 
368      * @param height a height object.
369      */
370     public void setHeight( String height )
371     {
372         this.height = height;
373     } //-- void setHeight( String )
374 
375     /**
376      * Set the source location of an menu image.
377      * 
378      * @param img a img object.
379      */
380     public void setImg( String img )
381     {
382         this.img = img;
383     } //-- void setImg( String )
384 
385     /**
386      * Set the way in which the menu is inherited. Can be one of :
387      * <code>top</code>, <code>bottom</code>.
388      * 
389      * @param inherit a inherit object.
390      */
391     public void setInherit( String inherit )
392     {
393         this.inherit = inherit;
394     } //-- void setInherit( String )
395 
396     /**
397      * Set if this is a reference, setting to <code>true</code>
398      * means that it will be populated
399      *             in the project, whereas if it is
400      * <code>false</code>, it is populated in the parent and then
401      * inherited.
402      * 
403      * @param inheritAsRef a inheritAsRef object.
404      */
405     public void setInheritAsRef( boolean inheritAsRef )
406     {
407         this.inheritAsRef = inheritAsRef;
408     } //-- void setInheritAsRef( boolean )
409 
410     /**
411      * Set a list of menu item.
412      * 
413      * @param items a items object.
414      */
415     public void setItems( java.util.List<MenuItem> items )
416     {
417         this.items = items;
418     } //-- void setItems( java.util.List )
419 
420     /**
421      * Set the name to display for the menu.
422      * 
423      * @param name a name object.
424      */
425     public void setName( String name )
426     {
427         this.name = name;
428     } //-- void setName( String )
429 
430     /**
431      * Set where to place the image regarding the displayed name
432      * (left or right).
433      * 
434      * @param position a position object.
435      */
436     public void setPosition( String position )
437     {
438         this.position = position;
439     } //-- void setPosition( String )
440 
441     /**
442      * Set mark this menu as reference to a pre-defined menu:
443      * <code>reports</code>, <code>modules</code>
444      *             or <code>parent</code>. It will be populated at
445      * runtime with corresponding pre-defined content.
446      * 
447      * @param ref a ref object.
448      */
449     public void setRef( String ref )
450     {
451         this.ref = ref;
452     } //-- void setRef( String )
453 
454     /**
455      * Set the title for the image.
456      * 
457      * @param title a title object.
458      */
459     public void setTitle( String title )
460     {
461         this.title = title;
462     } //-- void setTitle( String )
463 
464     /**
465      * Set the width to use for the menu image.
466      * 
467      * @param width a width object.
468      */
469     public void setWidth( String width )
470     {
471         this.width = width;
472     } //-- void setWidth( String )
473 
474     /**
475      * Method toString.
476      * 
477      * @return String
478      */
479     public java.lang.String toString()
480     {
481         StringBuilder buf = new StringBuilder( 128 );
482 
483         buf.append( "name = '" );
484         buf.append( getName() );
485         buf.append( "'" );
486         buf.append( "\n" ); 
487         buf.append( "inherit = '" );
488         buf.append( getInherit() );
489         buf.append( "'" );
490         buf.append( "\n" ); 
491         buf.append( "ref = '" );
492         buf.append( getRef() );
493         buf.append( "'" );
494         buf.append( "\n" ); 
495         buf.append( "img = '" );
496         buf.append( getImg() );
497         buf.append( "'" );
498         buf.append( "\n" ); 
499         buf.append( "alt = '" );
500         buf.append( getAlt() );
501         buf.append( "'" );
502         buf.append( "\n" ); 
503         buf.append( "position = '" );
504         buf.append( getPosition() );
505         buf.append( "'" );
506         buf.append( "\n" ); 
507         buf.append( "border = '" );
508         buf.append( getBorder() );
509         buf.append( "'" );
510         buf.append( "\n" ); 
511         buf.append( "width = '" );
512         buf.append( getWidth() );
513         buf.append( "'" );
514         buf.append( "\n" ); 
515         buf.append( "height = '" );
516         buf.append( getHeight() );
517         buf.append( "'" );
518         buf.append( "\n" ); 
519         buf.append( "title = '" );
520         buf.append( getTitle() );
521         buf.append( "'" );
522         buf.append( "\n" ); 
523         buf.append( "items = '" );
524         buf.append( getItems() );
525         buf.append( "'" );
526 
527         return buf.toString();
528     } //-- java.lang.String toString()
529 
530 }