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