001: // WARNING: This file was automatically generated. Do not edit it directly,
002: // or you will lose your changes.
003:
004: /*
005: * Licensed to the Apache Software Foundation (ASF) under one
006: * or more contributor license agreements. See the NOTICE file
007: * distributed with this work for additional information
008: * regarding copyright ownership. The ASF licenses this file
009: * to you under the Apache License, Version 2.0 (the
010: * "License"); you may not use this file except in compliance
011: * with the License. You may obtain a copy of the License at
012: *
013: * http://www.apache.org/licenses/LICENSE-2.0
014: *
015: * Unless required by applicable law or agreed to in writing,
016: * software distributed under the License is distributed on an
017: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
018: * KIND, either express or implied. See the License for the
019: * specific language governing permissions and limitations
020: * under the License.
021: */
022: package javax.faces.component;
023:
024: import javax.el.ValueExpression;
025: import javax.faces.context.FacesContext;
026:
027: /**
028: */
029: public class UIParameter extends UIComponentBase {
030:
031: static public final String COMPONENT_FAMILY = "javax.faces.Parameter";
032: static public final String COMPONENT_TYPE = "javax.faces.Parameter";
033:
034: /**
035: * Construct an instance of the UIParameter.
036: */
037: public UIParameter() {
038: setRendererType(null);
039: }
040:
041: // Property: value
042: private Object _value;
043:
044: /**
045: * Gets The value of this component.
046: *
047: * @return the new value value
048: */
049: public Object getValue() {
050: if (_value != null) {
051: return _value;
052: }
053: ValueExpression expression = getValueExpression("value");
054: if (expression != null) {
055: return expression
056: .getValue(getFacesContext().getELContext());
057: }
058: return null;
059: }
060:
061: /**
062: * Sets The value of this component.
063: *
064: * @param value the new value value
065: */
066: public void setValue(Object value) {
067: this ._value = value;
068: }
069:
070: // Property: name
071: private String _name;
072:
073: /**
074: * Gets The name under which the value is stored.
075: *
076: * @return the new name value
077: */
078: public String getName() {
079: if (_name != null) {
080: return _name;
081: }
082: ValueExpression expression = getValueExpression("name");
083: if (expression != null) {
084: return (String) expression.getValue(getFacesContext()
085: .getELContext());
086: }
087: return null;
088: }
089:
090: /**
091: * Sets The name under which the value is stored.
092: *
093: * @param name the new name value
094: */
095: public void setName(String name) {
096: this ._name = name;
097: }
098:
099: @Override
100: public Object saveState(FacesContext facesContext) {
101: Object[] values = new Object[3];
102: values[0] = super .saveState(facesContext);
103: values[1] = _value;
104: values[2] = _name;
105:
106: return values;
107: }
108:
109: @Override
110: public void restoreState(FacesContext facesContext, Object state) {
111: Object[] values = (Object[]) state;
112: super .restoreState(facesContext, values[0]);
113: _value = values[1];
114: _name = (String) values[2];
115: }
116:
117: @Override
118: public String getFamily() {
119: return COMPONENT_FAMILY;
120: }
121: }
|