1
2
3
4
5
6 package org.apache.maven.doxia.site.decoration;
7
8
9
10
11
12
13 @SuppressWarnings( "all" )
14 public class Menu
15 implements java.io.Serializable, java.lang.Cloneable
16 {
17
18
19
20
21
22
23
24
25 private String name;
26
27
28
29
30
31
32
33 private String inherit;
34
35
36
37
38
39
40
41
42
43
44 private boolean inheritAsRef = false;
45
46
47
48
49
50
51
52
53 private String ref;
54
55
56
57
58 private String img;
59
60
61
62
63 private String alt;
64
65
66
67
68
69 private String position = "left";
70
71
72
73
74 private String border;
75
76
77
78
79 private String width;
80
81
82
83
84 private String height;
85
86
87
88
89 private String title;
90
91
92
93
94 private java.util.List<MenuItem> items;
95
96
97
98
99
100
101
102
103
104
105
106 public void addItem( MenuItem menuItem )
107 {
108 getItems().add( menuItem );
109 }
110
111
112
113
114
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 }
139
140
141
142
143
144
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 }
175
176
177
178
179
180
181 public String getAlt()
182 {
183 return this.alt;
184 }
185
186
187
188
189
190
191 public String getBorder()
192 {
193 return this.border;
194 }
195
196
197
198
199
200
201 public String getHeight()
202 {
203 return this.height;
204 }
205
206
207
208
209
210
211 public String getImg()
212 {
213 return this.img;
214 }
215
216
217
218
219
220
221
222 public String getInherit()
223 {
224 return this.inherit;
225 }
226
227
228
229
230
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 }
241
242
243
244
245
246
247 public String getName()
248 {
249 return this.name;
250 }
251
252
253
254
255
256
257
258 public String getPosition()
259 {
260 return this.position;
261 }
262
263
264
265
266
267
268
269
270 public String getRef()
271 {
272 return this.ref;
273 }
274
275
276
277
278
279
280 public String getTitle()
281 {
282 return this.title;
283 }
284
285
286
287
288
289
290 public String getWidth()
291 {
292 return this.width;
293 }
294
295
296
297
298
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 }
318
319
320
321
322
323
324
325
326
327
328 public boolean isInheritAsRef()
329 {
330 return this.inheritAsRef;
331 }
332
333
334
335
336
337
338 public void removeItem( MenuItem menuItem )
339 {
340 getItems().remove( menuItem );
341 }
342
343
344
345
346
347
348 public void setAlt( String alt )
349 {
350 this.alt = alt;
351 }
352
353
354
355
356
357
358 public void setBorder( String border )
359 {
360 this.border = border;
361 }
362
363
364
365
366
367
368 public void setHeight( String height )
369 {
370 this.height = height;
371 }
372
373
374
375
376
377
378 public void setImg( String img )
379 {
380 this.img = img;
381 }
382
383
384
385
386
387
388
389 public void setInherit( String inherit )
390 {
391 this.inherit = inherit;
392 }
393
394
395
396
397
398
399
400
401
402
403 public void setInheritAsRef( boolean inheritAsRef )
404 {
405 this.inheritAsRef = inheritAsRef;
406 }
407
408
409
410
411
412
413 public void setItems( java.util.List<MenuItem> items )
414 {
415 this.items = items;
416 }
417
418
419
420
421
422
423 public void setName( String name )
424 {
425 this.name = name;
426 }
427
428
429
430
431
432
433
434 public void setPosition( String position )
435 {
436 this.position = position;
437 }
438
439
440
441
442
443
444
445
446 public void setRef( String ref )
447 {
448 this.ref = ref;
449 }
450
451
452
453
454
455
456 public void setTitle( String title )
457 {
458 this.title = title;
459 }
460
461
462
463
464
465
466 public void setWidth( String width )
467 {
468 this.width = width;
469 }
470
471
472
473
474
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 }
526
527 }