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 java.util.List<MenuItem> items;
92
93
94
95
96
97
98
99
100
101
102
103 public void addItem( MenuItem menuItem )
104 {
105 getItems().add( menuItem );
106 }
107
108
109
110
111
112
113 public Menu clone()
114 {
115 try
116 {
117 Menu copy = (Menu) super.clone();
118
119 if ( this.items != null )
120 {
121 copy.items = new java.util.ArrayList<MenuItem>();
122 for ( MenuItem item : this.items )
123 {
124 copy.items.add( ( (MenuItem) item).clone() );
125 }
126 }
127
128 return copy;
129 }
130 catch ( java.lang.Exception ex )
131 {
132 throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
133 + " does not support clone()" ).initCause( ex );
134 }
135 }
136
137
138
139
140
141
142
143 public boolean equals( Object other )
144 {
145 if ( this == other )
146 {
147 return true;
148 }
149
150 if ( !( other instanceof Menu ) )
151 {
152 return false;
153 }
154
155 Menu that = (Menu) other;
156 boolean result = true;
157
158 result = result && ( getName() == null ? that.getName() == null : getName().equals( that.getName() ) );
159 result = result && ( getInherit() == null ? that.getInherit() == null : getInherit().equals( that.getInherit() ) );
160 result = result && ( getRef() == null ? that.getRef() == null : getRef().equals( that.getRef() ) );
161 result = result && ( getImg() == null ? that.getImg() == null : getImg().equals( that.getImg() ) );
162 result = result && ( getAlt() == null ? that.getAlt() == null : getAlt().equals( that.getAlt() ) );
163 result = result && ( getPosition() == null ? that.getPosition() == null : getPosition().equals( that.getPosition() ) );
164 result = result && ( getBorder() == null ? that.getBorder() == null : getBorder().equals( that.getBorder() ) );
165 result = result && ( getWidth() == null ? that.getWidth() == null : getWidth().equals( that.getWidth() ) );
166 result = result && ( getHeight() == null ? that.getHeight() == null : getHeight().equals( that.getHeight() ) );
167 result = result && ( getItems() == null ? that.getItems() == null : getItems().equals( that.getItems() ) );
168
169 return result;
170 }
171
172
173
174
175
176
177 public String getAlt()
178 {
179 return this.alt;
180 }
181
182
183
184
185
186
187 public String getBorder()
188 {
189 return this.border;
190 }
191
192
193
194
195
196
197 public String getHeight()
198 {
199 return this.height;
200 }
201
202
203
204
205
206
207 public String getImg()
208 {
209 return this.img;
210 }
211
212
213
214
215
216
217
218 public String getInherit()
219 {
220 return this.inherit;
221 }
222
223
224
225
226
227
228 public java.util.List<MenuItem> getItems()
229 {
230 if ( this.items == null )
231 {
232 this.items = new java.util.ArrayList<MenuItem>();
233 }
234
235 return this.items;
236 }
237
238
239
240
241
242
243 public String getName()
244 {
245 return this.name;
246 }
247
248
249
250
251
252
253
254 public String getPosition()
255 {
256 return this.position;
257 }
258
259
260
261
262
263
264
265
266 public String getRef()
267 {
268 return this.ref;
269 }
270
271
272
273
274
275
276 public String getWidth()
277 {
278 return this.width;
279 }
280
281
282
283
284
285
286 public int hashCode()
287 {
288 int result = 17;
289
290 result = 37 * result + ( name != null ? name.hashCode() : 0 );
291 result = 37 * result + ( inherit != null ? inherit.hashCode() : 0 );
292 result = 37 * result + ( ref != null ? ref.hashCode() : 0 );
293 result = 37 * result + ( img != null ? img.hashCode() : 0 );
294 result = 37 * result + ( alt != null ? alt.hashCode() : 0 );
295 result = 37 * result + ( position != null ? position.hashCode() : 0 );
296 result = 37 * result + ( border != null ? border.hashCode() : 0 );
297 result = 37 * result + ( width != null ? width.hashCode() : 0 );
298 result = 37 * result + ( height != null ? height.hashCode() : 0 );
299 result = 37 * result + ( items != null ? items.hashCode() : 0 );
300
301 return result;
302 }
303
304
305
306
307
308
309
310
311
312
313 public boolean isInheritAsRef()
314 {
315 return this.inheritAsRef;
316 }
317
318
319
320
321
322
323 public void removeItem( MenuItem menuItem )
324 {
325 getItems().remove( menuItem );
326 }
327
328
329
330
331
332
333 public void setAlt( String alt )
334 {
335 this.alt = alt;
336 }
337
338
339
340
341
342
343 public void setBorder( String border )
344 {
345 this.border = border;
346 }
347
348
349
350
351
352
353 public void setHeight( String height )
354 {
355 this.height = height;
356 }
357
358
359
360
361
362
363 public void setImg( String img )
364 {
365 this.img = img;
366 }
367
368
369
370
371
372
373
374 public void setInherit( String inherit )
375 {
376 this.inherit = inherit;
377 }
378
379
380
381
382
383
384
385
386
387
388 public void setInheritAsRef( boolean inheritAsRef )
389 {
390 this.inheritAsRef = inheritAsRef;
391 }
392
393
394
395
396
397
398 public void setItems( java.util.List<MenuItem> items )
399 {
400 this.items = items;
401 }
402
403
404
405
406
407
408 public void setName( String name )
409 {
410 this.name = name;
411 }
412
413
414
415
416
417
418
419 public void setPosition( String position )
420 {
421 this.position = position;
422 }
423
424
425
426
427
428
429
430
431 public void setRef( String ref )
432 {
433 this.ref = ref;
434 }
435
436
437
438
439
440
441 public void setWidth( String width )
442 {
443 this.width = width;
444 }
445
446
447
448
449
450
451 public java.lang.String toString()
452 {
453 StringBuilder buf = new StringBuilder( 128 );
454
455 buf.append( "name = '" );
456 buf.append( getName() );
457 buf.append( "'" );
458 buf.append( "\n" );
459 buf.append( "inherit = '" );
460 buf.append( getInherit() );
461 buf.append( "'" );
462 buf.append( "\n" );
463 buf.append( "ref = '" );
464 buf.append( getRef() );
465 buf.append( "'" );
466 buf.append( "\n" );
467 buf.append( "img = '" );
468 buf.append( getImg() );
469 buf.append( "'" );
470 buf.append( "\n" );
471 buf.append( "alt = '" );
472 buf.append( getAlt() );
473 buf.append( "'" );
474 buf.append( "\n" );
475 buf.append( "position = '" );
476 buf.append( getPosition() );
477 buf.append( "'" );
478 buf.append( "\n" );
479 buf.append( "border = '" );
480 buf.append( getBorder() );
481 buf.append( "'" );
482 buf.append( "\n" );
483 buf.append( "width = '" );
484 buf.append( getWidth() );
485 buf.append( "'" );
486 buf.append( "\n" );
487 buf.append( "height = '" );
488 buf.append( getHeight() );
489 buf.append( "'" );
490 buf.append( "\n" );
491 buf.append( "items = '" );
492 buf.append( getItems() );
493 buf.append( "'" );
494
495 return buf.toString();
496 }
497
498 }