Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
LinkItem |
|
| 2.5416666666666665;2,542 |
1 | /* | |
2 | =================== DO NOT EDIT THIS FILE ==================== | |
3 | Generated by Modello 1.4.1 on 2012-04-17 22:28:45, | |
4 | any modifications will be overwritten. | |
5 | ============================================================== | |
6 | */ | |
7 | ||
8 | package org.apache.maven.doxia.site.decoration; | |
9 | ||
10 | /** | |
11 | * A link in the navigation. | |
12 | * | |
13 | * @version $Revision$ $Date$ | |
14 | */ | |
15 | @SuppressWarnings( "all" ) | |
16 | 420 | public class LinkItem |
17 | implements java.io.Serializable, java.lang.Cloneable | |
18 | { | |
19 | ||
20 | //--------------------------/ | |
21 | //- Class/Member Variables -/ | |
22 | //--------------------------/ | |
23 | ||
24 | /** | |
25 | * The name to display for the link. | |
26 | */ | |
27 | private String name; | |
28 | ||
29 | /** | |
30 | * The href to use for the link. | |
31 | */ | |
32 | private String href; | |
33 | ||
34 | /** | |
35 | * The source location of an image. | |
36 | */ | |
37 | private String img; | |
38 | ||
39 | /** | |
40 | * Where to place the image regarding the displayed name (left | |
41 | * or right). | |
42 | */ | |
43 | 420 | private String position = "left"; |
44 | ||
45 | /** | |
46 | * The alt to use for the image. | |
47 | */ | |
48 | private String alt; | |
49 | ||
50 | /** | |
51 | * The border to use for the image. | |
52 | */ | |
53 | private String border; | |
54 | ||
55 | /** | |
56 | * The width to use for the image. | |
57 | */ | |
58 | private String width; | |
59 | ||
60 | /** | |
61 | * The height to use for the image. | |
62 | */ | |
63 | private String height; | |
64 | ||
65 | /** | |
66 | * Where the new document will be displayed when the user | |
67 | * follows a link, i.e. _blank opens the new document in a new | |
68 | * window. | |
69 | */ | |
70 | private String target; | |
71 | ||
72 | /** | |
73 | * The title to use for the image. | |
74 | */ | |
75 | private String title; | |
76 | ||
77 | ||
78 | //-----------/ | |
79 | //- Methods -/ | |
80 | //-----------/ | |
81 | ||
82 | /** | |
83 | * Method clone. | |
84 | * | |
85 | * @return LinkItem | |
86 | */ | |
87 | public LinkItem clone() | |
88 | { | |
89 | try | |
90 | { | |
91 | 172 | LinkItem copy = (LinkItem) super.clone(); |
92 | ||
93 | 172 | return copy; |
94 | } | |
95 | 0 | catch ( java.lang.Exception ex ) |
96 | { | |
97 | 0 | throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName() |
98 | + " does not support clone()" ).initCause( ex ); | |
99 | } | |
100 | } //-- LinkItem clone() | |
101 | ||
102 | /** | |
103 | * Method equals. | |
104 | * | |
105 | * @param other | |
106 | * @return boolean | |
107 | */ | |
108 | public boolean equals( Object other ) | |
109 | { | |
110 | 382 | if ( this == other ) |
111 | { | |
112 | 0 | return true; |
113 | } | |
114 | ||
115 | 382 | if ( !( other instanceof LinkItem ) ) |
116 | { | |
117 | 0 | return false; |
118 | } | |
119 | ||
120 | 382 | LinkItem that = (LinkItem) other; |
121 | 382 | boolean result = true; |
122 | ||
123 | 382 | result = result && ( getName() == null ? that.getName() == null : getName().equals( that.getName() ) ); |
124 | 382 | result = result && ( getHref() == null ? that.getHref() == null : getHref().equals( that.getHref() ) ); |
125 | 382 | result = result && ( getImg() == null ? that.getImg() == null : getImg().equals( that.getImg() ) ); |
126 | 382 | result = result && ( getPosition() == null ? that.getPosition() == null : getPosition().equals( that.getPosition() ) ); |
127 | 382 | result = result && ( getAlt() == null ? that.getAlt() == null : getAlt().equals( that.getAlt() ) ); |
128 | 382 | result = result && ( getBorder() == null ? that.getBorder() == null : getBorder().equals( that.getBorder() ) ); |
129 | 382 | result = result && ( getWidth() == null ? that.getWidth() == null : getWidth().equals( that.getWidth() ) ); |
130 | 382 | result = result && ( getHeight() == null ? that.getHeight() == null : getHeight().equals( that.getHeight() ) ); |
131 | 382 | result = result && ( getTarget() == null ? that.getTarget() == null : getTarget().equals( that.getTarget() ) ); |
132 | 382 | result = result && ( getTitle() == null ? that.getTitle() == null : getTitle().equals( that.getTitle() ) ); |
133 | ||
134 | 382 | return result; |
135 | } //-- boolean equals( Object ) | |
136 | ||
137 | /** | |
138 | * Get the alt to use for the image. | |
139 | * | |
140 | * @return String | |
141 | */ | |
142 | public String getAlt() | |
143 | { | |
144 | 500 | return this.alt; |
145 | } //-- String getAlt() | |
146 | ||
147 | /** | |
148 | * Get the border to use for the image. | |
149 | * | |
150 | * @return String | |
151 | */ | |
152 | public String getBorder() | |
153 | { | |
154 | 500 | return this.border; |
155 | } //-- String getBorder() | |
156 | ||
157 | /** | |
158 | * Get the height to use for the image. | |
159 | * | |
160 | * @return String | |
161 | */ | |
162 | public String getHeight() | |
163 | { | |
164 | 500 | return this.height; |
165 | } //-- String getHeight() | |
166 | ||
167 | /** | |
168 | * Get the href to use for the link. | |
169 | * | |
170 | * @return String | |
171 | */ | |
172 | public String getHref() | |
173 | { | |
174 | 1082 | return this.href; |
175 | } //-- String getHref() | |
176 | ||
177 | /** | |
178 | * Get the source location of an image. | |
179 | * | |
180 | * @return String | |
181 | */ | |
182 | public String getImg() | |
183 | { | |
184 | 638 | return this.img; |
185 | } //-- String getImg() | |
186 | ||
187 | /** | |
188 | * Get the name to display for the link. | |
189 | * | |
190 | * @return String | |
191 | */ | |
192 | public String getName() | |
193 | { | |
194 | 1146 | return this.name; |
195 | } //-- String getName() | |
196 | ||
197 | /** | |
198 | * Get where to place the image regarding the displayed name | |
199 | * (left or right). | |
200 | * | |
201 | * @return String | |
202 | */ | |
203 | public String getPosition() | |
204 | { | |
205 | 750 | return this.position; |
206 | } //-- String getPosition() | |
207 | ||
208 | /** | |
209 | * Get where the new document will be displayed when the user | |
210 | * follows a link, i.e. _blank opens the new document in a new | |
211 | * window. | |
212 | * | |
213 | * @return String | |
214 | */ | |
215 | public String getTarget() | |
216 | { | |
217 | 500 | return this.target; |
218 | } //-- String getTarget() | |
219 | ||
220 | /** | |
221 | * Get the title to use for the image. | |
222 | * | |
223 | * @return String | |
224 | */ | |
225 | public String getTitle() | |
226 | { | |
227 | 500 | return this.title; |
228 | } //-- String getTitle() | |
229 | ||
230 | /** | |
231 | * Get the width to use for the image. | |
232 | * | |
233 | * @return String | |
234 | */ | |
235 | public String getWidth() | |
236 | { | |
237 | 500 | return this.width; |
238 | } //-- String getWidth() | |
239 | ||
240 | /** | |
241 | * Method hashCode. | |
242 | * | |
243 | * @return int | |
244 | */ | |
245 | public int hashCode() | |
246 | { | |
247 | 0 | int result = 17; |
248 | ||
249 | 0 | result = 37 * result + ( name != null ? name.hashCode() : 0 ); |
250 | 0 | result = 37 * result + ( href != null ? href.hashCode() : 0 ); |
251 | 0 | result = 37 * result + ( img != null ? img.hashCode() : 0 ); |
252 | 0 | result = 37 * result + ( position != null ? position.hashCode() : 0 ); |
253 | 0 | result = 37 * result + ( alt != null ? alt.hashCode() : 0 ); |
254 | 0 | result = 37 * result + ( border != null ? border.hashCode() : 0 ); |
255 | 0 | result = 37 * result + ( width != null ? width.hashCode() : 0 ); |
256 | 0 | result = 37 * result + ( height != null ? height.hashCode() : 0 ); |
257 | 0 | result = 37 * result + ( target != null ? target.hashCode() : 0 ); |
258 | 0 | result = 37 * result + ( title != null ? title.hashCode() : 0 ); |
259 | ||
260 | 0 | return result; |
261 | } //-- int hashCode() | |
262 | ||
263 | /** | |
264 | * Set the alt to use for the image. | |
265 | * | |
266 | * @param alt | |
267 | */ | |
268 | public void setAlt( String alt ) | |
269 | { | |
270 | 0 | this.alt = alt; |
271 | 0 | } //-- void setAlt( String ) |
272 | ||
273 | /** | |
274 | * Set the border to use for the image. | |
275 | * | |
276 | * @param border | |
277 | */ | |
278 | public void setBorder( String border ) | |
279 | { | |
280 | 0 | this.border = border; |
281 | 0 | } //-- void setBorder( String ) |
282 | ||
283 | /** | |
284 | * Set the height to use for the image. | |
285 | * | |
286 | * @param height | |
287 | */ | |
288 | public void setHeight( String height ) | |
289 | { | |
290 | 0 | this.height = height; |
291 | 0 | } //-- void setHeight( String ) |
292 | ||
293 | /** | |
294 | * Set the href to use for the link. | |
295 | * | |
296 | * @param href | |
297 | */ | |
298 | public void setHref( String href ) | |
299 | { | |
300 | 654 | this.href = href; |
301 | 654 | } //-- void setHref( String ) |
302 | ||
303 | /** | |
304 | * Set the source location of an image. | |
305 | * | |
306 | * @param img | |
307 | */ | |
308 | public void setImg( String img ) | |
309 | { | |
310 | 138 | this.img = img; |
311 | 138 | } //-- void setImg( String ) |
312 | ||
313 | /** | |
314 | * Set the name to display for the link. | |
315 | * | |
316 | * @param name | |
317 | */ | |
318 | public void setName( String name ) | |
319 | { | |
320 | 420 | this.name = name; |
321 | 420 | } //-- void setName( String ) |
322 | ||
323 | /** | |
324 | * Set where to place the image regarding the displayed name | |
325 | * (left or right). | |
326 | * | |
327 | * @param position | |
328 | */ | |
329 | public void setPosition( String position ) | |
330 | { | |
331 | 0 | this.position = position; |
332 | 0 | } //-- void setPosition( String ) |
333 | ||
334 | /** | |
335 | * Set where the new document will be displayed when the user | |
336 | * follows a link, i.e. _blank opens the new document in a new | |
337 | * window. | |
338 | * | |
339 | * @param target | |
340 | */ | |
341 | public void setTarget( String target ) | |
342 | { | |
343 | 0 | this.target = target; |
344 | 0 | } //-- void setTarget( String ) |
345 | ||
346 | /** | |
347 | * Set the title to use for the image. | |
348 | * | |
349 | * @param title | |
350 | */ | |
351 | public void setTitle( String title ) | |
352 | { | |
353 | 0 | this.title = title; |
354 | 0 | } //-- void setTitle( String ) |
355 | ||
356 | /** | |
357 | * Set the width to use for the image. | |
358 | * | |
359 | * @param width | |
360 | */ | |
361 | public void setWidth( String width ) | |
362 | { | |
363 | 0 | this.width = width; |
364 | 0 | } //-- void setWidth( String ) |
365 | ||
366 | /** | |
367 | * Method toString. | |
368 | * | |
369 | * @return String | |
370 | */ | |
371 | public java.lang.String toString() | |
372 | { | |
373 | 0 | StringBuilder buf = new StringBuilder( 128 ); |
374 | ||
375 | 0 | buf.append( "name = '" ); |
376 | 0 | buf.append( getName() ); |
377 | 0 | buf.append( "'" ); |
378 | 0 | buf.append( "\n" ); |
379 | 0 | buf.append( "href = '" ); |
380 | 0 | buf.append( getHref() ); |
381 | 0 | buf.append( "'" ); |
382 | 0 | buf.append( "\n" ); |
383 | 0 | buf.append( "img = '" ); |
384 | 0 | buf.append( getImg() ); |
385 | 0 | buf.append( "'" ); |
386 | 0 | buf.append( "\n" ); |
387 | 0 | buf.append( "position = '" ); |
388 | 0 | buf.append( getPosition() ); |
389 | 0 | buf.append( "'" ); |
390 | 0 | buf.append( "\n" ); |
391 | 0 | buf.append( "alt = '" ); |
392 | 0 | buf.append( getAlt() ); |
393 | 0 | buf.append( "'" ); |
394 | 0 | buf.append( "\n" ); |
395 | 0 | buf.append( "border = '" ); |
396 | 0 | buf.append( getBorder() ); |
397 | 0 | buf.append( "'" ); |
398 | 0 | buf.append( "\n" ); |
399 | 0 | buf.append( "width = '" ); |
400 | 0 | buf.append( getWidth() ); |
401 | 0 | buf.append( "'" ); |
402 | 0 | buf.append( "\n" ); |
403 | 0 | buf.append( "height = '" ); |
404 | 0 | buf.append( getHeight() ); |
405 | 0 | buf.append( "'" ); |
406 | 0 | buf.append( "\n" ); |
407 | 0 | buf.append( "target = '" ); |
408 | 0 | buf.append( getTarget() ); |
409 | 0 | buf.append( "'" ); |
410 | 0 | buf.append( "\n" ); |
411 | 0 | buf.append( "title = '" ); |
412 | 0 | buf.append( getTitle() ); |
413 | 0 | buf.append( "'" ); |
414 | ||
415 | 0 | return buf.toString(); |
416 | } //-- java.lang.String toString() | |
417 | ||
418 | } |