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