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 Body
17 implements java.io.Serializable, java.lang.Cloneable
18 {
19
20
21
22
23
24
25
26
27
28 private Object head;
29
30
31
32
33 private java.util.List<LinkItem> links;
34
35
36
37
38 private java.util.List<LinkItem> breadcrumbs;
39
40
41
42
43 private java.util.List<Menu> menus;
44
45
46
47
48
49 private Object footer;
50
51
52
53
54
55
56
57
58
59
60
61 public void addBreadcrumb( LinkItem linkItem )
62 {
63 getBreadcrumbs().add( linkItem );
64 }
65
66
67
68
69
70
71 public void addLink( LinkItem linkItem )
72 {
73 getLinks().add( linkItem );
74 }
75
76
77
78
79
80
81 public void addMenu( Menu menu )
82 {
83 getMenus().add( menu );
84 }
85
86
87
88
89
90
91 public Body clone()
92 {
93 try
94 {
95 Body copy = (Body) super.clone();
96
97 if ( this.head != null )
98 {
99 copy.head = new org.codehaus.plexus.util.xml.Xpp3Dom( (org.codehaus.plexus.util.xml.Xpp3Dom) this.head );
100 }
101
102 if ( this.links != null )
103 {
104 copy.links = new java.util.ArrayList<LinkItem>();
105 for ( LinkItem item : this.links )
106 {
107 copy.links.add( ( (LinkItem) item).clone() );
108 }
109 }
110
111 if ( this.breadcrumbs != null )
112 {
113 copy.breadcrumbs = new java.util.ArrayList<LinkItem>();
114 for ( LinkItem item : this.breadcrumbs )
115 {
116 copy.breadcrumbs.add( ( (LinkItem) item).clone() );
117 }
118 }
119
120 if ( this.menus != null )
121 {
122 copy.menus = new java.util.ArrayList<Menu>();
123 for ( Menu item : this.menus )
124 {
125 copy.menus.add( ( (Menu) item).clone() );
126 }
127 }
128
129 if ( this.footer != null )
130 {
131 copy.footer = new org.codehaus.plexus.util.xml.Xpp3Dom( (org.codehaus.plexus.util.xml.Xpp3Dom) this.footer );
132 }
133
134 return copy;
135 }
136 catch ( java.lang.Exception ex )
137 {
138 throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
139 + " does not support clone()" ).initCause( ex );
140 }
141 }
142
143
144
145
146
147
148
149 public boolean equals( Object other )
150 {
151 if ( this == other )
152 {
153 return true;
154 }
155
156 if ( !( other instanceof Body ) )
157 {
158 return false;
159 }
160
161 Body that = (Body) other;
162 boolean result = true;
163
164 result = result && ( getHead() == null ? that.getHead() == null : getHead().equals( that.getHead() ) );
165 result = result && ( getLinks() == null ? that.getLinks() == null : getLinks().equals( that.getLinks() ) );
166 result = result && ( getBreadcrumbs() == null ? that.getBreadcrumbs() == null : getBreadcrumbs().equals( that.getBreadcrumbs() ) );
167 result = result && ( getMenus() == null ? that.getMenus() == null : getMenus().equals( that.getMenus() ) );
168 result = result && ( getFooter() == null ? that.getFooter() == null : getFooter().equals( that.getFooter() ) );
169
170 return result;
171 }
172
173
174
175
176
177
178 public java.util.List<LinkItem> getBreadcrumbs()
179 {
180 if ( this.breadcrumbs == null )
181 {
182 this.breadcrumbs = new java.util.ArrayList<LinkItem>();
183 }
184
185 return this.breadcrumbs;
186 }
187
188
189
190
191
192
193
194 public Object getFooter()
195 {
196 return this.footer;
197 }
198
199
200
201
202
203
204
205 public Object getHead()
206 {
207 return this.head;
208 }
209
210
211
212
213
214
215 public java.util.List<LinkItem> getLinks()
216 {
217 if ( this.links == null )
218 {
219 this.links = new java.util.ArrayList<LinkItem>();
220 }
221
222 return this.links;
223 }
224
225
226
227
228
229
230 public java.util.List<Menu> getMenus()
231 {
232 if ( this.menus == null )
233 {
234 this.menus = new java.util.ArrayList<Menu>();
235 }
236
237 return this.menus;
238 }
239
240
241
242
243
244
245 public int hashCode()
246 {
247 int result = 17;
248
249 result = 37 * result + ( head != null ? head.hashCode() : 0 );
250 result = 37 * result + ( links != null ? links.hashCode() : 0 );
251 result = 37 * result + ( breadcrumbs != null ? breadcrumbs.hashCode() : 0 );
252 result = 37 * result + ( menus != null ? menus.hashCode() : 0 );
253 result = 37 * result + ( footer != null ? footer.hashCode() : 0 );
254
255 return result;
256 }
257
258
259
260
261
262
263 public void removeBreadcrumb( LinkItem linkItem )
264 {
265 getBreadcrumbs().remove( linkItem );
266 }
267
268
269
270
271
272
273 public void removeLink( LinkItem linkItem )
274 {
275 getLinks().remove( linkItem );
276 }
277
278
279
280
281
282
283 public void removeMenu( Menu menu )
284 {
285 getMenus().remove( menu );
286 }
287
288
289
290
291
292
293 public void setBreadcrumbs( java.util.List<LinkItem> breadcrumbs )
294 {
295 this.breadcrumbs = breadcrumbs;
296 }
297
298
299
300
301
302
303
304 public void setFooter( Object footer )
305 {
306 this.footer = footer;
307 }
308
309
310
311
312
313
314
315 public void setHead( Object head )
316 {
317 this.head = head;
318 }
319
320
321
322
323
324
325 public void setLinks( java.util.List<LinkItem> links )
326 {
327 this.links = links;
328 }
329
330
331
332
333
334
335 public void setMenus( java.util.List<Menu> menus )
336 {
337 this.menus = menus;
338 }
339
340
341
342
343
344
345 public java.lang.String toString()
346 {
347 StringBuilder buf = new StringBuilder( 128 );
348
349 buf.append( "head = '" );
350 buf.append( getHead() );
351 buf.append( "'" );
352 buf.append( "\n" );
353 buf.append( "links = '" );
354 buf.append( getLinks() );
355 buf.append( "'" );
356 buf.append( "\n" );
357 buf.append( "breadcrumbs = '" );
358 buf.append( getBreadcrumbs() );
359 buf.append( "'" );
360 buf.append( "\n" );
361 buf.append( "menus = '" );
362 buf.append( getMenus() );
363 buf.append( "'" );
364 buf.append( "\n" );
365 buf.append( "footer = '" );
366 buf.append( getFooter() );
367 buf.append( "'" );
368
369 return buf.toString();
370 }
371
372 }