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