View Javadoc

1   /*
2    =================== DO NOT EDIT THIS FILE ====================
3    Generated by Modello 1.4.1 on 2012-04-17 22:27:23,
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       * The title for the image.
90       */
91      private String title;
92  
93      /**
94       * Field items.
95       */
96      private java.util.List<MenuItem> items;
97  
98  
99        //-----------/
100      //- Methods -/
101     //-----------/
102 
103     /**
104      * Method addItem.
105      * 
106      * @param menuItem
107      */
108     public void addItem( MenuItem menuItem )
109     {
110         getItems().add( menuItem );
111     } //-- void addItem( MenuItem )
112 
113     /**
114      * Method clone.
115      * 
116      * @return Menu
117      */
118     public Menu clone()
119     {
120         try
121         {
122             Menu copy = (Menu) super.clone();
123 
124             if ( this.items != null )
125             {
126                 copy.items = new java.util.ArrayList<MenuItem>();
127                 for ( MenuItem item : this.items )
128                 {
129                     copy.items.add( ( (MenuItem) item).clone() );
130                 }
131             }
132 
133             return copy;
134         }
135         catch ( java.lang.Exception ex )
136         {
137             throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
138                 + " does not support clone()" ).initCause( ex );
139         }
140     } //-- Menu clone()
141 
142     /**
143      * Method equals.
144      * 
145      * @param other
146      * @return boolean
147      */
148     public boolean equals( Object other )
149     {
150         if ( this == other )
151         {
152             return true;
153         }
154 
155         if ( !( other instanceof Menu ) )
156         {
157             return false;
158         }
159 
160         Menu that = (Menu) other;
161         boolean result = true;
162 
163         result = result && ( getName() == null ? that.getName() == null : getName().equals( that.getName() ) );
164         result = result && ( getInherit() == null ? that.getInherit() == null : getInherit().equals( that.getInherit() ) );
165         result = result && ( getRef() == null ? that.getRef() == null : getRef().equals( that.getRef() ) );
166         result = result && ( getImg() == null ? that.getImg() == null : getImg().equals( that.getImg() ) );
167         result = result && ( getAlt() == null ? that.getAlt() == null : getAlt().equals( that.getAlt() ) );
168         result = result && ( getPosition() == null ? that.getPosition() == null : getPosition().equals( that.getPosition() ) );
169         result = result && ( getBorder() == null ? that.getBorder() == null : getBorder().equals( that.getBorder() ) );
170         result = result && ( getWidth() == null ? that.getWidth() == null : getWidth().equals( that.getWidth() ) );
171         result = result && ( getHeight() == null ? that.getHeight() == null : getHeight().equals( that.getHeight() ) );
172         result = result && ( getTitle() == null ? that.getTitle() == null : getTitle().equals( that.getTitle() ) );
173         result = result && ( getItems() == null ? that.getItems() == null : getItems().equals( that.getItems() ) );
174 
175         return result;
176     } //-- boolean equals( Object )
177 
178     /**
179      * Get the alt description for the image.
180      * 
181      * @return String
182      */
183     public String getAlt()
184     {
185         return this.alt;
186     } //-- String getAlt()
187 
188     /**
189      * Get the border to use for the menu image.
190      * 
191      * @return String
192      */
193     public String getBorder()
194     {
195         return this.border;
196     } //-- String getBorder()
197 
198     /**
199      * Get the height to use for the menu image.
200      * 
201      * @return String
202      */
203     public String getHeight()
204     {
205         return this.height;
206     } //-- String getHeight()
207 
208     /**
209      * Get the source location of an menu image.
210      * 
211      * @return String
212      */
213     public String getImg()
214     {
215         return this.img;
216     } //-- String getImg()
217 
218     /**
219      * Get the way in which the menu is inherited. Can be one of :
220      * <code>top</code>, <code>bottom</code>.
221      * 
222      * @return String
223      */
224     public String getInherit()
225     {
226         return this.inherit;
227     } //-- String getInherit()
228 
229     /**
230      * Method getItems.
231      * 
232      * @return List
233      */
234     public java.util.List<MenuItem> getItems()
235     {
236         if ( this.items == null )
237         {
238             this.items = new java.util.ArrayList<MenuItem>();
239         }
240 
241         return this.items;
242     } //-- java.util.List<MenuItem> getItems()
243 
244     /**
245      * Get the name to display for the menu.
246      * 
247      * @return String
248      */
249     public String getName()
250     {
251         return this.name;
252     } //-- String getName()
253 
254     /**
255      * Get where to place the image regarding the displayed name
256      * (left or right).
257      * 
258      * @return String
259      */
260     public String getPosition()
261     {
262         return this.position;
263     } //-- String getPosition()
264 
265     /**
266      * Get a reference to a pre-defined menu, such as a
267      * <code>reports</code>, <code>modules</code>
268      *             or <code>parent</code>.
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
323      * <inheritAsRef>true</inheritAsRef> means that it will be
324      * populated
325      *             in the project, whereas if it is false, it is
326      * populated in the parent and then 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
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
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
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
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
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
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
398      * <inheritAsRef>true</inheritAsRef> means that it will be
399      * populated
400      *             in the project, whereas if it is false, it is
401      * populated in the parent and then inherited.
402      * 
403      * @param inheritAsRef
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
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
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
435      */
436     public void setPosition( String position )
437     {
438         this.position = position;
439     } //-- void setPosition( String )
440 
441     /**
442      * Set a reference to a pre-defined menu, such as a
443      * <code>reports</code>, <code>modules</code>
444      *             or <code>parent</code>.
445      * 
446      * @param ref
447      */
448     public void setRef( String ref )
449     {
450         this.ref = ref;
451     } //-- void setRef( String )
452 
453     /**
454      * Set the title for the image.
455      * 
456      * @param title
457      */
458     public void setTitle( String title )
459     {
460         this.title = title;
461     } //-- void setTitle( String )
462 
463     /**
464      * Set the width to use for the menu image.
465      * 
466      * @param width
467      */
468     public void setWidth( String width )
469     {
470         this.width = width;
471     } //-- void setWidth( String )
472 
473     /**
474      * Method toString.
475      * 
476      * @return String
477      */
478     public java.lang.String toString()
479     {
480         StringBuilder buf = new StringBuilder( 128 );
481 
482         buf.append( "name = '" );
483         buf.append( getName() );
484         buf.append( "'" );
485         buf.append( "\n" ); 
486         buf.append( "inherit = '" );
487         buf.append( getInherit() );
488         buf.append( "'" );
489         buf.append( "\n" ); 
490         buf.append( "ref = '" );
491         buf.append( getRef() );
492         buf.append( "'" );
493         buf.append( "\n" ); 
494         buf.append( "img = '" );
495         buf.append( getImg() );
496         buf.append( "'" );
497         buf.append( "\n" ); 
498         buf.append( "alt = '" );
499         buf.append( getAlt() );
500         buf.append( "'" );
501         buf.append( "\n" ); 
502         buf.append( "position = '" );
503         buf.append( getPosition() );
504         buf.append( "'" );
505         buf.append( "\n" ); 
506         buf.append( "border = '" );
507         buf.append( getBorder() );
508         buf.append( "'" );
509         buf.append( "\n" ); 
510         buf.append( "width = '" );
511         buf.append( getWidth() );
512         buf.append( "'" );
513         buf.append( "\n" ); 
514         buf.append( "height = '" );
515         buf.append( getHeight() );
516         buf.append( "'" );
517         buf.append( "\n" ); 
518         buf.append( "title = '" );
519         buf.append( getTitle() );
520         buf.append( "'" );
521         buf.append( "\n" ); 
522         buf.append( "items = '" );
523         buf.append( getItems() );
524         buf.append( "'" );
525 
526         return buf.toString();
527     } //-- java.lang.String toString()
528 
529 }