Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: javax/faces/component/UIParameter.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;
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: 278655 $ $Date: 2005-09-04 20:33:10 -0400 (Sun, 04 Sep 2005) $
26   */
27  public class UIParameter
28          extends UIComponentBase
29  {
30      //------------------ GENERATED CODE BEGIN (do not modify!) --------------------
31  
32      public static final String COMPONENT_TYPE = "javax.faces.Parameter";
33      public static final String COMPONENT_FAMILY = "javax.faces.Parameter";
34  
35      private String _name = null;
36      private Object _value = null;
37  
38      public UIParameter()
39      {
40      }
41  
42      public String getFamily()
43      {
44          return COMPONENT_FAMILY;
45      }
46  
47      public void setName(String name)
48      {
49          _name = name;
50      }
51  
52      public String getName()
53      {
54          if (_name != null) return _name;
55          ValueBinding vb = getValueBinding("name");
56          return vb != null ? (String)vb.getValue(getFacesContext()) : null;
57      }
58  
59      public void setValue(Object value)
60      {
61          _value = value;
62      }
63  
64      public Object getValue()
65      {
66          if (_value != null) return _value;
67          ValueBinding vb = getValueBinding("value");
68          return vb != null ? (Object)vb.getValue(getFacesContext()) : null;
69      }
70  
71  
72      public Object saveState(FacesContext context)
73      {
74          Object values[] = new Object[3];
75          values[0] = super.saveState(context);
76          values[1] = _name;
77          values[2] = _value;
78          return ((Object) (values));
79      }
80  
81      public void restoreState(FacesContext context, Object state)
82      {
83          Object values[] = (Object[])state;
84          super.restoreState(context, values[0]);
85          _name = (String)values[1];
86          _value = (Object)values[2];
87      }
88      //------------------ GENERATED CODE END ---------------------------------------
89  
90  }