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 String 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 String 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.links != null )
96 {
97 copy.links = new java.util.ArrayList<LinkItem>();
98 for ( LinkItem item : this.links )
99 {
100 copy.links.add( ( (LinkItem) item).clone() );
101 }
102 }
103
104 if ( this.breadcrumbs != null )
105 {
106 copy.breadcrumbs = new java.util.ArrayList<LinkItem>();
107 for ( LinkItem item : this.breadcrumbs )
108 {
109 copy.breadcrumbs.add( ( (LinkItem) item).clone() );
110 }
111 }
112
113 if ( this.menus != null )
114 {
115 copy.menus = new java.util.ArrayList<Menu>();
116 for ( Menu item : this.menus )
117 {
118 copy.menus.add( ( (Menu) item).clone() );
119 }
120 }
121
122 return copy;
123 }
124 catch ( java.lang.Exception ex )
125 {
126 throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
127 + " does not support clone()" ).initCause( ex );
128 }
129 }
130
131
132
133
134
135
136
137 public boolean equals( Object other )
138 {
139 if ( this == other )
140 {
141 return true;
142 }
143
144 if ( !( other instanceof Body ) )
145 {
146 return false;
147 }
148
149 Body that = (Body) other;
150 boolean result = true;
151
152 result = result && ( getHead() == null ? that.getHead() == null : getHead().equals( that.getHead() ) );
153 result = result && ( getLinks() == null ? that.getLinks() == null : getLinks().equals( that.getLinks() ) );
154 result = result && ( getBreadcrumbs() == null ? that.getBreadcrumbs() == null : getBreadcrumbs().equals( that.getBreadcrumbs() ) );
155 result = result && ( getMenus() == null ? that.getMenus() == null : getMenus().equals( that.getMenus() ) );
156 result = result && ( getFooter() == null ? that.getFooter() == null : getFooter().equals( that.getFooter() ) );
157
158 return result;
159 }
160
161
162
163
164
165
166 public java.util.List<LinkItem> getBreadcrumbs()
167 {
168 if ( this.breadcrumbs == null )
169 {
170 this.breadcrumbs = new java.util.ArrayList<LinkItem>();
171 }
172
173 return this.breadcrumbs;
174 }
175
176
177
178
179
180
181
182 public String getFooter()
183 {
184 return this.footer;
185 }
186
187
188
189
190
191
192
193 public String getHead()
194 {
195 return this.head;
196 }
197
198
199
200
201
202
203 public java.util.List<LinkItem> getLinks()
204 {
205 if ( this.links == null )
206 {
207 this.links = new java.util.ArrayList<LinkItem>();
208 }
209
210 return this.links;
211 }
212
213
214
215
216
217
218 public java.util.List<Menu> getMenus()
219 {
220 if ( this.menus == null )
221 {
222 this.menus = new java.util.ArrayList<Menu>();
223 }
224
225 return this.menus;
226 }
227
228
229
230
231
232
233 public int hashCode()
234 {
235 int result = 17;
236
237 result = 37 * result + ( head != null ? head.hashCode() : 0 );
238 result = 37 * result + ( links != null ? links.hashCode() : 0 );
239 result = 37 * result + ( breadcrumbs != null ? breadcrumbs.hashCode() : 0 );
240 result = 37 * result + ( menus != null ? menus.hashCode() : 0 );
241 result = 37 * result + ( footer != null ? footer.hashCode() : 0 );
242
243 return result;
244 }
245
246
247
248
249
250
251 public void removeBreadcrumb( LinkItem linkItem )
252 {
253 getBreadcrumbs().remove( linkItem );
254 }
255
256
257
258
259
260
261 public void removeLink( LinkItem linkItem )
262 {
263 getLinks().remove( linkItem );
264 }
265
266
267
268
269
270
271 public void removeMenu( Menu menu )
272 {
273 getMenus().remove( menu );
274 }
275
276
277
278
279
280
281 public void setBreadcrumbs( java.util.List<LinkItem> breadcrumbs )
282 {
283 this.breadcrumbs = breadcrumbs;
284 }
285
286
287
288
289
290
291
292 public void setFooter( String footer )
293 {
294 this.footer = footer;
295 }
296
297
298
299
300
301
302
303 public void setHead( String head )
304 {
305 this.head = head;
306 }
307
308
309
310
311
312
313 public void setLinks( java.util.List<LinkItem> links )
314 {
315 this.links = links;
316 }
317
318
319
320
321
322
323 public void setMenus( java.util.List<Menu> menus )
324 {
325 this.menus = menus;
326 }
327
328
329
330
331
332
333 public java.lang.String toString()
334 {
335 StringBuilder buf = new StringBuilder( 128 );
336
337 buf.append( "head = '" );
338 buf.append( getHead() );
339 buf.append( "'" );
340 buf.append( "\n" );
341 buf.append( "links = '" );
342 buf.append( getLinks() );
343 buf.append( "'" );
344 buf.append( "\n" );
345 buf.append( "breadcrumbs = '" );
346 buf.append( getBreadcrumbs() );
347 buf.append( "'" );
348 buf.append( "\n" );
349 buf.append( "menus = '" );
350 buf.append( getMenus() );
351 buf.append( "'" );
352 buf.append( "\n" );
353 buf.append( "footer = '" );
354 buf.append( getFooter() );
355 buf.append( "'" );
356
357 return buf.toString();
358 }
359
360 }