| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package javax.faces.component; |
| 17 | |
|
| 18 | |
import javax.faces.context.FacesContext; |
| 19 | |
import javax.faces.convert.Converter; |
| 20 | |
|
| 21 | |
|
| 22 | |
|
| 23 | |
|
| 24 | |
public class UIOutput extends UIComponentBase implements ValueHolder { |
| 25 | |
|
| 26 | |
public static final String COMPONENT_TYPE = "javax.faces.Output"; |
| 27 | |
|
| 28 | |
public static final String COMPONENT_FAMILY = "javax.faces.Output"; |
| 29 | |
|
| 30 | 3458 | private Converter converter = null; |
| 31 | |
|
| 32 | 3458 | private Object value = null; |
| 33 | |
|
| 34 | |
private static final String DEFAULT_RENDER_TYPE = "javax.faces.Text"; |
| 35 | |
|
| 36 | 3458 | public UIOutput() { |
| 37 | 3458 | setRendererType(DEFAULT_RENDER_TYPE); |
| 38 | 3458 | } |
| 39 | |
|
| 40 | |
public String getFamily() { |
| 41 | 60 | return COMPONENT_FAMILY; |
| 42 | |
} |
| 43 | |
|
| 44 | |
public Converter getConverter() { |
| 45 | 359 | if (converter != null) { |
| 46 | 65 | return converter; |
| 47 | |
} |
| 48 | 294 | return (Converter) ComponentUtil_.getValueBindingValue(this, |
| 49 | |
"converter"); |
| 50 | |
} |
| 51 | |
|
| 52 | |
public void setConverter(Converter converter) { |
| 53 | 70 | this.converter = converter; |
| 54 | 70 | } |
| 55 | |
|
| 56 | |
public Object getLocalValue() { |
| 57 | 220 | return value; |
| 58 | |
} |
| 59 | |
|
| 60 | |
public Object getValue() { |
| 61 | 380 | if (value != null) { |
| 62 | 168 | return value; |
| 63 | |
} |
| 64 | 212 | return ComponentUtil_.getValueBindingValue(this, "value"); |
| 65 | |
} |
| 66 | |
|
| 67 | |
public void setValue(Object value) { |
| 68 | 362 | this.value = value; |
| 69 | 362 | } |
| 70 | |
|
| 71 | |
public void restoreState(FacesContext context, Object state) { |
| 72 | 77 | Object[] values = (Object[]) state; |
| 73 | 77 | super.restoreState(context, values[0]); |
| 74 | 77 | converter = (Converter) restoreAttachedState(context, values[1]); |
| 75 | 77 | value = values[2]; |
| 76 | 77 | } |
| 77 | |
|
| 78 | |
public Object saveState(FacesContext context) { |
| 79 | 97 | Object[] values = new Object[4]; |
| 80 | 97 | values[0] = super.saveState(context); |
| 81 | 97 | values[1] = saveAttachedState(context, converter); |
| 82 | 97 | values[2] = value; |
| 83 | 97 | return values; |
| 84 | |
} |
| 85 | |
} |