1
2
3
4
5
6
7
8 package org.apache.maven.doxia.site.decoration;
9
10
11
12
13
14
15 @SuppressWarnings( "all" )
16 public class Menu
17 implements java.io.Serializable, java.lang.Cloneable
18 {
19
20
21
22
23
24
25
26
27 private String name;
28
29
30
31
32
33
34
35 private String inherit;
36
37
38
39
40
41
42
43
44
45
46 private boolean inheritAsRef = false;
47
48
49
50
51
52
53
54
55 private String ref;
56
57
58
59
60 private String img;
61
62
63
64
65 private String alt;
66
67
68
69
70
71 private String position = "left";
72
73
74
75
76 private String border;
77
78
79
80
81 private String width;
82
83
84
85
86 private String height;
87
88
89
90
91 private String title;
92
93
94
95
96 private java.util.List<MenuItem> items;
97
98
99
100
101
102
103
104
105
106
107
108 public void addItem( MenuItem menuItem )
109 {
110 getItems().add( menuItem );
111 }
112
113
114
115
116
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 }
141
142
143
144
145
146
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 }
177
178
179
180
181
182
183 public String getAlt()
184 {
185 return this.alt;
186 }
187
188
189
190
191
192
193 public String getBorder()
194 {
195 return this.border;
196 }
197
198
199
200
201
202
203 public String getHeight()
204 {
205 return this.height;
206 }
207
208
209
210
211
212
213 public String getImg()
214 {
215 return this.img;
216 }
217
218
219
220
221
222
223
224 public String getInherit()
225 {
226 return this.inherit;
227 }
228
229
230
231
232
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 }
243
244
245
246
247
248
249 public String getName()
250 {
251 return this.name;
252 }
253
254
255
256
257
258
259
260 public String getPosition()
261 {
262 return this.position;
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 public void setRef( String ref )
449 {
450 this.ref = ref;
451 }
452
453
454
455
456
457
458 public void setTitle( String title )
459 {
460 this.title = title;
461 }
462
463
464
465
466
467
468 public void setWidth( String width )
469 {
470 this.width = width;
471 }
472
473
474
475
476
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 }
528
529 }