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: import javax.faces.convert.Converter;
027:
028: /**
029: */
030: public class UIOutput extends UIComponentBase implements ValueHolder {
031:
032: static public final String COMPONENT_FAMILY = "javax.faces.Output";
033: static public final String COMPONENT_TYPE = "javax.faces.Output";
034:
035: /**
036: * Construct an instance of the UIOutput.
037: */
038: public UIOutput() {
039: setRendererType("javax.faces.Text");
040: }
041:
042: public Object getLocalValue() {
043: return _value;
044: }
045:
046: // Property: value
047: private Object _value;
048:
049: /**
050: * Gets The initial value of this component.
051: *
052: * @return the new value value
053: */
054: public Object getValue() {
055: if (_value != null) {
056: return _value;
057: }
058: ValueExpression expression = getValueExpression("value");
059: if (expression != null) {
060: return expression
061: .getValue(getFacesContext().getELContext());
062: }
063: return null;
064: }
065:
066: /**
067: * Sets The initial value of this component.
068: *
069: * @param value the new value value
070: */
071: public void setValue(Object value) {
072: this ._value = value;
073: }
074:
075: // Property: converter
076: private Converter _converter;
077:
078: /**
079: * Gets An Instance ot the Converter
080: *
081: * @return the new converter value
082: */
083: public Converter getConverter() {
084: if (_converter != null) {
085: return _converter;
086: }
087: ValueExpression expression = getValueExpression("converter");
088: if (expression != null) {
089: return (Converter) expression.getValue(getFacesContext()
090: .getELContext());
091: }
092: return null;
093: }
094:
095: /**
096: * Sets An Instance ot the Converter
097: *
098: * @param converter the new converter value
099: */
100: public void setConverter(Converter converter) {
101: this ._converter = converter;
102: }
103:
104: @Override
105: public Object saveState(FacesContext facesContext) {
106: Object[] values = new Object[3];
107: values[0] = super .saveState(facesContext);
108: values[1] = _value;
109: values[2] = saveAttachedState(facesContext, _converter);
110:
111: return values;
112: }
113:
114: @Override
115: public void restoreState(FacesContext facesContext, Object state) {
116: Object[] values = (Object[]) state;
117: super .restoreState(facesContext, values[0]);
118: _value = values[1];
119: _converter = (Converter) restoreAttachedState(facesContext,
120: values[2]);
121: }
122:
123: @Override
124: public String getFamily() {
125: return COMPONENT_FAMILY;
126: }
127: }
|