Source code: javax/faces/component/html/HtmlInputSecret.java
1 /*
2 * Copyright 2004 The Apache Software Foundation.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package javax.faces.component.html;
17
18 import javax.faces.component.UIInput;
19 import javax.faces.context.FacesContext;
20 import javax.faces.el.ValueBinding;
21
22 /**
23 * @author Thomas Spiegl (latest modification by $Author: grantsmith $)
24 * @version $Revision: 210184 $ $Date: 2005-07-11 15:09:45 -0400 (Mon, 11 Jul 2005) $
25 */
26 public class HtmlInputSecret extends UIInput
27 {
28 //------------------ GENERATED CODE BEGIN (do not modify!) --------------------
29
30 public static final String COMPONENT_TYPE = "javax.faces.HtmlInputSecret";
31 private static final String DEFAULT_RENDERER_TYPE = "javax.faces.Secret";
32 private static final boolean DEFAULT_DISABLED = false;
33 private static final int DEFAULT_MAXLENGTH = Integer.MIN_VALUE;
34 private static final boolean DEFAULT_READONLY = false;
35 private static final boolean DEFAULT_REDISPLAY = false;
36 private static final int DEFAULT_SIZE = Integer.MIN_VALUE;
37
38 private String _accesskey = null;
39 private String _alt = null;
40 private String _dir = null;
41 private Boolean _disabled = null;
42 private String _lang = null;
43 private Integer _maxlength = null;
44 private String _onblur = null;
45 private String _onchange = null;
46 private String _onclick = null;
47 private String _ondblclick = null;
48 private String _onfocus = null;
49 private String _onkeydown = null;
50 private String _onkeypress = null;
51 private String _onkeyup = null;
52 private String _onmousedown = null;
53 private String _onmousemove = null;
54 private String _onmouseout = null;
55 private String _onmouseover = null;
56 private String _onmouseup = null;
57 private String _onselect = null;
58 private Boolean _readonly = null;
59 private Boolean _redisplay = null;
60 private Integer _size = null;
61 private String _style = null;
62 private String _styleClass = null;
63 private String _tabindex = null;
64 private String _title = null;
65
66 public HtmlInputSecret()
67 {
68 setRendererType(DEFAULT_RENDERER_TYPE);
69 }
70
71
72 public void setAccesskey(String accesskey)
73 {
74 _accesskey = accesskey;
75 }
76
77 public String getAccesskey()
78 {
79 if (_accesskey != null) return _accesskey;
80 ValueBinding vb = getValueBinding("accesskey");
81 return vb != null ? (String)vb.getValue(getFacesContext()) : null;
82 }
83
84 public void setAlt(String alt)
85 {
86 _alt = alt;
87 }
88
89 public String getAlt()
90 {
91 if (_alt != null) return _alt;
92 ValueBinding vb = getValueBinding("alt");
93 return vb != null ? (String)vb.getValue(getFacesContext()) : null;
94 }
95
96 public void setDir(String dir)
97 {
98 _dir = dir;
99 }
100
101 public String getDir()
102 {
103 if (_dir != null) return _dir;
104 ValueBinding vb = getValueBinding("dir");
105 return vb != null ? (String)vb.getValue(getFacesContext()) : null;
106 }
107
108 public void setDisabled(boolean disabled)
109 {
110 _disabled = Boolean.valueOf(disabled);
111 }
112
113 public boolean isDisabled()
114 {
115 if (_disabled != null) return _disabled.booleanValue();
116 ValueBinding vb = getValueBinding("disabled");
117 Boolean v = vb != null ? (Boolean)vb.getValue(getFacesContext()) : null;
118 return v != null ? v.booleanValue() : DEFAULT_DISABLED;
119 }
120
121 public void setLang(String lang)
122 {
123 _lang = lang;
124 }
125
126 public String getLang()
127 {
128 if (_lang != null) return _lang;
129 ValueBinding vb = getValueBinding("lang");
130 return vb != null ? (String)vb.getValue(getFacesContext()) : null;
131 }
132
133 public void setMaxlength(int maxlength)
134 {
135 _maxlength = new Integer(maxlength);
136 }
137
138 public int getMaxlength()
139 {
140 if (_maxlength != null) return _maxlength.intValue();
141 ValueBinding vb = getValueBinding("maxlength");
142 Number v = vb != null ? (Number)vb.getValue(getFacesContext()) : null;
143 return v != null ? v.intValue() : DEFAULT_MAXLENGTH;
144 }
145
146 public void setOnblur(String onblur)
147 {
148 _onblur = onblur;
149 }
150
151 public String getOnblur()
152 {
153 if (_onblur != null) return _onblur;
154 ValueBinding vb = getValueBinding("onblur");
155 return vb != null ? (String)vb.getValue(getFacesContext()) : null;
156 }
157
158 public void setOnchange(String onchange)
159 {
160 _onchange = onchange;
161 }
162
163 public String getOnchange()
164 {
165 if (_onchange != null) return _onchange;
166 ValueBinding vb = getValueBinding("onchange");
167 return vb != null ? (String)vb.getValue(getFacesContext()) : null;
168 }
169
170 public void setOnclick(String onclick)
171 {
172 _onclick = onclick;
173 }
174
175 public String getOnclick()
176 {
177 if (_onclick != null) return _onclick;
178 ValueBinding vb = getValueBinding("onclick");
179 return vb != null ? (String)vb.getValue(getFacesContext()) : null;
180 }
181
182 public void setOndblclick(String ondblclick)
183 {
184 _ondblclick = ondblclick;
185 }
186
187 public String getOndblclick()
188 {
189 if (_ondblclick != null) return _ondblclick;
190 ValueBinding vb = getValueBinding("ondblclick");
191 return vb != null ? (String)vb.getValue(getFacesContext()) : null;
192 }
193
194 public void setOnfocus(String onfocus)
195 {
196 _onfocus = onfocus;
197 }
198
199 public String getOnfocus()
200 {
201 if (_onfocus != null) return _onfocus;
202 ValueBinding vb = getValueBinding("onfocus");
203 return vb != null ? (String)vb.getValue(getFacesContext()) : null;
204 }
205
206 public void setOnkeydown(String onkeydown)
207 {
208 _onkeydown = onkeydown;
209 }
210
211 public String getOnkeydown()
212 {
213 if (_onkeydown != null) return _onkeydown;
214 ValueBinding vb = getValueBinding("onkeydown");
215 return vb != null ? (String)vb.getValue(getFacesContext()) : null;
216 }
217
218 public void setOnkeypress(String onkeypress)
219 {
220 _onkeypress = onkeypress;
221 }
222
223 public String getOnkeypress()
224 {
225 if (_onkeypress != null) return _onkeypress;
226 ValueBinding vb = getValueBinding("onkeypress");
227 return vb != null ? (String)vb.getValue(getFacesContext()) : null;
228 }
229
230 public void setOnkeyup(String onkeyup)
231 {
232 _onkeyup = onkeyup;
233 }
234
235 public String getOnkeyup()
236 {
237 if (_onkeyup != null) return _onkeyup;
238 ValueBinding vb = getValueBinding("onkeyup");
239 return vb != null ? (String)vb.getValue(getFacesContext()) : null;
240 }
241
242 public void setOnmousedown(String onmousedown)
243 {
244 _onmousedown = onmousedown;
245 }
246
247 public String getOnmousedown()
248 {
249 if (_onmousedown != null) return _onmousedown;
250 ValueBinding vb = getValueBinding("onmousedown");
251 return vb != null ? (String)vb.getValue(getFacesContext()) : null;
252 }
253
254 public void setOnmousemove(String onmousemove)
255 {
256 _onmousemove = onmousemove;
257 }
258
259 public String getOnmousemove()
260 {
261 if (_onmousemove != null) return _onmousemove;
262 ValueBinding vb = getValueBinding("onmousemove");
263 return vb != null ? (String)vb.getValue(getFacesContext()) : null;
264 }
265
266 public void setOnmouseout(String onmouseout)
267 {
268 _onmouseout = onmouseout;
269 }
270
271 public String getOnmouseout()
272 {
273 if (_onmouseout != null) return _onmouseout;
274 ValueBinding vb = getValueBinding("onmouseout");
275 return vb != null ? (String)vb.getValue(getFacesContext()) : null;
276 }
277
278 public void setOnmouseover(String onmouseover)
279 {
280 _onmouseover = onmouseover;
281 }
282
283 public String getOnmouseover()
284 {
285 if (_onmouseover != null) return _onmouseover;
286 ValueBinding vb = getValueBinding("onmouseover");
287 return vb != null ? (String)vb.getValue(getFacesContext()) : null;
288 }
289
290 public void setOnmouseup(String onmouseup)
291 {
292 _onmouseup = onmouseup;
293 }
294
295 public String getOnmouseup()
296 {
297 if (_onmouseup != null) return _onmouseup;
298 ValueBinding vb = getValueBinding("onmouseup");
299 return vb != null ? (String)vb.getValue(getFacesContext()) : null;
300 }
301
302 public void setOnselect(String onselect)
303 {
304 _onselect = onselect;
305 }
306
307 public String getOnselect()
308 {
309 if (_onselect != null) return _onselect;
310 ValueBinding vb = getValueBinding("onselect");
311 return vb != null ? (String)vb.getValue(getFacesContext()) : null;
312 }
313
314 public void setReadonly(boolean readonly)
315 {
316 _readonly = Boolean.valueOf(readonly);
317 }
318
319 public boolean isReadonly()
320 {
321 if (_readonly != null) return _readonly.booleanValue();
322 ValueBinding vb = getValueBinding("readonly");
323 Boolean v = vb != null ? (Boolean)vb.getValue(getFacesContext()) : null;
324 return v != null ? v.booleanValue() : DEFAULT_READONLY;
325 }
326
327 public void setRedisplay(boolean redisplay)
328 {
329 _redisplay = Boolean.valueOf(redisplay);
330 }
331
332 public boolean isRedisplay()
333 {
334 if (_redisplay != null) return _redisplay.booleanValue();
335 ValueBinding vb = getValueBinding("redisplay");
336 Boolean v = vb != null ? (Boolean)vb.getValue(getFacesContext()) : null;
337 return v != null ? v.booleanValue() : DEFAULT_REDISPLAY;
338 }
339
340 public void setSize(int size)
341 {
342 _size = new Integer(size);
343 }
344
345 public int getSize()
346 {
347 if (_size != null) return _size.intValue();
348 ValueBinding vb = getValueBinding("size");
349 Number v = vb != null ? (Number)vb.getValue(getFacesContext()) : null;
350 return v != null ? v.intValue() : DEFAULT_SIZE;
351 }
352
353 public void setStyle(String style)
354 {
355 _style = style;
356 }
357
358 public String getStyle()
359 {
360 if (_style != null) return _style;
361 ValueBinding vb = getValueBinding("style");
362 return vb != null ? (String)vb.getValue(getFacesContext()) : null;
363 }
364
365 public void setStyleClass(String styleClass)
366 {
367 _styleClass = styleClass;
368 }
369
370 public String getStyleClass()
371 {
372 if (_styleClass != null) return _styleClass;
373 ValueBinding vb = getValueBinding("styleClass");
374 return vb != null ? (String)vb.getValue(getFacesContext()) : null;
375 }
376
377 public void setTabindex(String tabindex)
378 {
379 _tabindex = tabindex;
380 }
381
382 public String getTabindex()
383 {
384 if (_tabindex != null) return _tabindex;
385 ValueBinding vb = getValueBinding("tabindex");
386 return vb != null ? (String)vb.getValue(getFacesContext()) : null;
387 }
388
389 public void setTitle(String title)
390 {
391 _title = title;
392 }
393
394 public String getTitle()
395 {
396 if (_title != null) return _title;
397 ValueBinding vb = getValueBinding("title");
398 return vb != null ? (String)vb.getValue(getFacesContext()) : null;
399 }
400
401
402 public Object saveState(FacesContext context)
403 {
404 Object values[] = new Object[28];
405 values[0] = super.saveState(context);
406 values[1] = _accesskey;
407 values[2] = _alt;
408 values[3] = _dir;
409 values[4] = _disabled;
410 values[5] = _lang;
411 values[6] = _maxlength;
412 values[7] = _onblur;
413 values[8] = _onchange;
414 values[9] = _onclick;
415 values[10] = _ondblclick;
416 values[11] = _onfocus;
417 values[12] = _onkeydown;
418 values[13] = _onkeypress;
419 values[14] = _onkeyup;
420 values[15] = _onmousedown;
421 values[16] = _onmousemove;
422 values[17] = _onmouseout;
423 values[18] = _onmouseover;
424 values[19] = _onmouseup;
425 values[20] = _onselect;
426 values[21] = _readonly;
427 values[22] = _redisplay;
428 values[23] = _size;
429 values[24] = _style;
430 values[25] = _styleClass;
431 values[26] = _tabindex;
432 values[27] = _title;
433 return ((Object) (values));
434 }
435
436 public void restoreState(FacesContext context, Object state)
437 {
438 Object values[] = (Object[])state;
439 super.restoreState(context, values[0]);
440 _accesskey = (String)values[1];
441 _alt = (String)values[2];
442 _dir = (String)values[3];
443 _disabled = (Boolean)values[4];
444 _lang = (String)values[5];
445 _maxlength = (Integer)values[6];
446 _onblur = (String)values[7];
447 _onchange = (String)values[8];
448 _onclick = (String)values[9];
449 _ondblclick = (String)values[10];
450 _onfocus = (String)values[11];
451 _onkeydown = (String)values[12];
452 _onkeypress = (String)values[13];
453 _onkeyup = (String)values[14];
454 _onmousedown = (String)values[15];
455 _onmousemove = (String)values[16];
456 _onmouseout = (String)values[17];
457 _onmouseover = (String)values[18];
458 _onmouseup = (String)values[19];
459 _onselect = (String)values[20];
460 _readonly = (Boolean)values[21];
461 _redisplay = (Boolean)values[22];
462 _size = (Integer)values[23];
463 _style = (String)values[24];
464 _styleClass = (String)values[25];
465 _tabindex = (String)values[26];
466 _title = (String)values[27];
467 }
468 //------------------ GENERATED CODE END ---------------------------------------
469 }