Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
LinkItem |
|
| 2.5454545454545454;2,545 |
1 | /* | |
2 | =================== DO NOT EDIT THIS FILE ==================== | |
3 | Generated by Modello 1.4.1 on 2011-04-27 00:03:43, | |
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 | 1206 | 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 | 1206 | 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 | //-----------/ | |
74 | //- Methods -/ | |
75 | //-----------/ | |
76 | ||
77 | /** | |
78 | * Method clone. | |
79 | * | |
80 | * @return LinkItem | |
81 | */ | |
82 | public LinkItem clone() | |
83 | { | |
84 | try | |
85 | { | |
86 | 522 | LinkItem copy = (LinkItem) super.clone(); |
87 | ||
88 | 522 | return copy; |
89 | } | |
90 | 0 | catch ( java.lang.Exception ex ) |
91 | { | |
92 | 0 | throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName() |
93 | + " does not support clone()" ).initCause( ex ); | |
94 | } | |
95 | } //-- LinkItem clone() | |
96 | ||
97 | /** | |
98 | * Method equals. | |
99 | * | |
100 | * @param other | |
101 | * @return boolean | |
102 | */ | |
103 | public boolean equals( Object other ) | |
104 | { | |
105 | 924 | if ( this == other ) |
106 | { | |
107 | 0 | return true; |
108 | } | |
109 | ||
110 | 924 | if ( !( other instanceof LinkItem ) ) |
111 | { | |
112 | 0 | return false; |
113 | } | |
114 | ||
115 | 924 | LinkItem that = (LinkItem) other; |
116 | 924 | boolean result = true; |
117 | ||
118 | 924 | result = result && ( getName() == null ? that.getName() == null : getName().equals( that.getName() ) ); |
119 | 924 | result = result && ( getHref() == null ? that.getHref() == null : getHref().equals( that.getHref() ) ); |
120 | 924 | result = result && ( getImg() == null ? that.getImg() == null : getImg().equals( that.getImg() ) ); |
121 | 924 | result = result && ( getPosition() == null ? that.getPosition() == null : getPosition().equals( that.getPosition() ) ); |
122 | 924 | result = result && ( getAlt() == null ? that.getAlt() == null : getAlt().equals( that.getAlt() ) ); |
123 | 924 | result = result && ( getBorder() == null ? that.getBorder() == null : getBorder().equals( that.getBorder() ) ); |
124 | 924 | result = result && ( getWidth() == null ? that.getWidth() == null : getWidth().equals( that.getWidth() ) ); |
125 | 924 | result = result && ( getHeight() == null ? that.getHeight() == null : getHeight().equals( that.getHeight() ) ); |
126 | 924 | result = result && ( getTarget() == null ? that.getTarget() == null : getTarget().equals( that.getTarget() ) ); |
127 | ||
128 | 924 | return result; |
129 | } //-- boolean equals( Object ) | |
130 | ||
131 | /** | |
132 | * Get the alt to use for the image. | |
133 | * | |
134 | * @return String | |
135 | */ | |
136 | public String getAlt() | |
137 | { | |
138 | 1452 | return this.alt; |
139 | } //-- String getAlt() | |
140 | ||
141 | /** | |
142 | * Get the border to use for the image. | |
143 | * | |
144 | * @return String | |
145 | */ | |
146 | public String getBorder() | |
147 | { | |
148 | 1452 | return this.border; |
149 | } //-- String getBorder() | |
150 | ||
151 | /** | |
152 | * Get the height to use for the image. | |
153 | * | |
154 | * @return String | |
155 | */ | |
156 | public String getHeight() | |
157 | { | |
158 | 1452 | return this.height; |
159 | } //-- String getHeight() | |
160 | ||
161 | /** | |
162 | * Get the href to use for the link. | |
163 | * | |
164 | * @return String | |
165 | */ | |
166 | public String getHref() | |
167 | { | |
168 | 3204 | return this.href; |
169 | } //-- String getHref() | |
170 | ||
171 | /** | |
172 | * Get the source location of an image. | |
173 | * | |
174 | * @return String | |
175 | */ | |
176 | public String getImg() | |
177 | { | |
178 | 1866 | return this.img; |
179 | } //-- String getImg() | |
180 | ||
181 | /** | |
182 | * Get the name to display for the link. | |
183 | * | |
184 | * @return String | |
185 | */ | |
186 | public String getName() | |
187 | { | |
188 | 2772 | return this.name; |
189 | } //-- String getName() | |
190 | ||
191 | /** | |
192 | * Get where to place the image regarding the displayed name | |
193 | * (left or right). | |
194 | * | |
195 | * @return String | |
196 | */ | |
197 | public String getPosition() | |
198 | { | |
199 | 2178 | return this.position; |
200 | } //-- String getPosition() | |
201 | ||
202 | /** | |
203 | * Get where the new document will be displayed when the user | |
204 | * follows a link, i.e. _blank opens the new document in a new | |
205 | * window. | |
206 | * | |
207 | * @return String | |
208 | */ | |
209 | public String getTarget() | |
210 | { | |
211 | 1452 | return this.target; |
212 | } //-- String getTarget() | |
213 | ||
214 | /** | |
215 | * Get the width to use for the image. | |
216 | * | |
217 | * @return String | |
218 | */ | |
219 | public String getWidth() | |
220 | { | |
221 | 1452 | return this.width; |
222 | } //-- String getWidth() | |
223 | ||
224 | /** | |
225 | * Method hashCode. | |
226 | * | |
227 | * @return int | |
228 | */ | |
229 | public int hashCode() | |
230 | { | |
231 | 0 | int result = 17; |
232 | ||
233 | 0 | result = 37 * result + ( name != null ? name.hashCode() : 0 ); |
234 | 0 | result = 37 * result + ( href != null ? href.hashCode() : 0 ); |
235 | 0 | result = 37 * result + ( img != null ? img.hashCode() : 0 ); |
236 | 0 | result = 37 * result + ( position != null ? position.hashCode() : 0 ); |
237 | 0 | result = 37 * result + ( alt != null ? alt.hashCode() : 0 ); |
238 | 0 | result = 37 * result + ( border != null ? border.hashCode() : 0 ); |
239 | 0 | result = 37 * result + ( width != null ? width.hashCode() : 0 ); |
240 | 0 | result = 37 * result + ( height != null ? height.hashCode() : 0 ); |
241 | 0 | result = 37 * result + ( target != null ? target.hashCode() : 0 ); |
242 | ||
243 | 0 | return result; |
244 | } //-- int hashCode() | |
245 | ||
246 | /** | |
247 | * Set the alt to use for the image. | |
248 | * | |
249 | * @param alt | |
250 | */ | |
251 | public void setAlt( String alt ) | |
252 | { | |
253 | 0 | this.alt = alt; |
254 | 0 | } //-- void setAlt( String ) |
255 | ||
256 | /** | |
257 | * Set the border to use for the image. | |
258 | * | |
259 | * @param border | |
260 | */ | |
261 | public void setBorder( String border ) | |
262 | { | |
263 | 0 | this.border = border; |
264 | 0 | } //-- void setBorder( String ) |
265 | ||
266 | /** | |
267 | * Set the height to use for the image. | |
268 | * | |
269 | * @param height | |
270 | */ | |
271 | public void setHeight( String height ) | |
272 | { | |
273 | 0 | this.height = height; |
274 | 0 | } //-- void setHeight( String ) |
275 | ||
276 | /** | |
277 | * Set the href to use for the link. | |
278 | * | |
279 | * @param href | |
280 | */ | |
281 | public void setHref( String href ) | |
282 | { | |
283 | 1914 | this.href = href; |
284 | 1914 | } //-- void setHref( String ) |
285 | ||
286 | /** | |
287 | * Set the source location of an image. | |
288 | * | |
289 | * @param img | |
290 | */ | |
291 | public void setImg( String img ) | |
292 | { | |
293 | 414 | this.img = img; |
294 | 414 | } //-- void setImg( String ) |
295 | ||
296 | /** | |
297 | * Set the name to display for the link. | |
298 | * | |
299 | * @param name | |
300 | */ | |
301 | public void setName( String name ) | |
302 | { | |
303 | 1206 | this.name = name; |
304 | 1206 | } //-- void setName( String ) |
305 | ||
306 | /** | |
307 | * Set where to place the image regarding the displayed name | |
308 | * (left or right). | |
309 | * | |
310 | * @param position | |
311 | */ | |
312 | public void setPosition( String position ) | |
313 | { | |
314 | 0 | this.position = position; |
315 | 0 | } //-- void setPosition( String ) |
316 | ||
317 | /** | |
318 | * Set where the new document will be displayed when the user | |
319 | * follows a link, i.e. _blank opens the new document in a new | |
320 | * window. | |
321 | * | |
322 | * @param target | |
323 | */ | |
324 | public void setTarget( String target ) | |
325 | { | |
326 | 0 | this.target = target; |
327 | 0 | } //-- void setTarget( String ) |
328 | ||
329 | /** | |
330 | * Set the width to use for the image. | |
331 | * | |
332 | * @param width | |
333 | */ | |
334 | public void setWidth( String width ) | |
335 | { | |
336 | 0 | this.width = width; |
337 | 0 | } //-- void setWidth( String ) |
338 | ||
339 | /** | |
340 | * Method toString. | |
341 | * | |
342 | * @return String | |
343 | */ | |
344 | public java.lang.String toString() | |
345 | { | |
346 | 0 | StringBuilder buf = new StringBuilder( 128 ); |
347 | ||
348 | 0 | buf.append( "name = '" ); |
349 | 0 | buf.append( getName() ); |
350 | 0 | buf.append( "'" ); |
351 | 0 | buf.append( "\n" ); |
352 | 0 | buf.append( "href = '" ); |
353 | 0 | buf.append( getHref() ); |
354 | 0 | buf.append( "'" ); |
355 | 0 | buf.append( "\n" ); |
356 | 0 | buf.append( "img = '" ); |
357 | 0 | buf.append( getImg() ); |
358 | 0 | buf.append( "'" ); |
359 | 0 | buf.append( "\n" ); |
360 | 0 | buf.append( "position = '" ); |
361 | 0 | buf.append( getPosition() ); |
362 | 0 | buf.append( "'" ); |
363 | 0 | buf.append( "\n" ); |
364 | 0 | buf.append( "alt = '" ); |
365 | 0 | buf.append( getAlt() ); |
366 | 0 | buf.append( "'" ); |
367 | 0 | buf.append( "\n" ); |
368 | 0 | buf.append( "border = '" ); |
369 | 0 | buf.append( getBorder() ); |
370 | 0 | buf.append( "'" ); |
371 | 0 | buf.append( "\n" ); |
372 | 0 | buf.append( "width = '" ); |
373 | 0 | buf.append( getWidth() ); |
374 | 0 | buf.append( "'" ); |
375 | 0 | buf.append( "\n" ); |
376 | 0 | buf.append( "height = '" ); |
377 | 0 | buf.append( getHeight() ); |
378 | 0 | buf.append( "'" ); |
379 | 0 | buf.append( "\n" ); |
380 | 0 | buf.append( "target = '" ); |
381 | 0 | buf.append( getTarget() ); |
382 | 0 | buf.append( "'" ); |
383 | ||
384 | 0 | return buf.toString(); |
385 | } //-- java.lang.String toString() | |
386 | ||
387 | } |