KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > faces > component > UIParameter


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;
17
18 import javax.faces.context.FacesContext;
19 import javax.faces.el.ValueBinding;
20
21 /**
22  * see Javadoc of JSF Specification
23  *
24  * @author Manfred Geiler (latest modification by $Author: oros $)
25  * @version $Revision: 1.6 $ $Date: 2004/12/09 01:27:13 $
26  */

27 public class UIParameter
28         extends UIComponentBase
29 {
30     //------------------ GENERATED CODE BEGIN (do not modify!) --------------------
31

32     public static final String JavaDoc COMPONENT_TYPE = "javax.faces.Parameter";
33     public static final String JavaDoc COMPONENT_FAMILY = "javax.faces.Parameter";
34
35     private String JavaDoc _name = null;
36     private Object JavaDoc _value = null;
37
38     public UIParameter()
39     {
40     }
41
42     public String JavaDoc getFamily()
43     {
44         return COMPONENT_FAMILY;
45     }
46
47     public void setName(String JavaDoc name)
48     {
49         _name = name;
50     }
51
52     public String JavaDoc getName()
53     {
54         if (_name != null) return _name;
55         ValueBinding vb = getValueBinding("name");
56         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
57     }
58
59     public void setValue(Object JavaDoc value)
60     {
61         _value = value;
62     }
63
64     public Object JavaDoc getValue()
65     {
66         if (_value != null) return _value;
67         ValueBinding vb = getValueBinding("value");
68         return vb != null ? (Object JavaDoc)vb.getValue(getFacesContext()) : null;
69     }
70
71
72     public Object JavaDoc saveState(FacesContext context)
73     {
74         Object JavaDoc values[] = new Object JavaDoc[3];
75         values[0] = super.saveState(context);
76         values[1] = _name;
77         values[2] = _value;
78         return ((Object JavaDoc) (values));
79     }
80
81     public void restoreState(FacesContext context, Object JavaDoc state)
82     {
83         Object JavaDoc values[] = (Object JavaDoc[])state;
84         super.restoreState(context, values[0]);
85         _name = (String JavaDoc)values[1];
86         _value = (Object JavaDoc)values[2];
87     }
88     //------------------ GENERATED CODE END ---------------------------------------
89

90    public boolean isRendered()
91     {
92         // a parameter is never rendered
93
return false;
94     }
95 }
96
Popular Tags