1 16 package javax.faces.component; 17 18 import javax.faces.context.FacesContext; 19 import javax.faces.el.ValueBinding; 20 21 27 public class UIParameter 28 extends UIComponentBase 29 { 30 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 90 public boolean isRendered() 91 { 92 return false; 94 } 95 } 96 | Popular Tags |