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