javax.faces.component
public class: UIOutput [javadoc |
source]
java.lang.Object
javax.faces.component.UIComponent
javax.faces.component.UIComponentBase
javax.faces.component.UIOutput
All Implemented Interfaces:
ValueHolder, StateHolder
Direct Known Subclasses:
UISelectMany, HtmlSelectOneListbox, HtmlSelectManyCheckbox, UISelectBoolean, HtmlOutputFormat, HtmlSelectManyListbox, HtmlSelectBooleanCheckbox, HtmlSelectManyMenu, HtmlInputHidden, HtmlInputSecret, HtmlSelectOneMenu, HtmlInputText, UISelectOne, HtmlSelectOneRadio, HtmlOutputLabel, UIInput, HtmlOutputLink, HtmlInputTextarea, HtmlOutputText
UIOutput is a UIComponent that has a
value, optionally retrieved from a model tier bean via a value
expression, that is displayed to the user. The user cannot directly
modify the rendered value; it is for display purposes only.
During the Render Response phase of the request processing
lifecycle, the current value of this component must be
converted to a String (if it is not already), according to the following
rules:
- If the current value is not
null, and is not already
a String, locate a Converter (if any) to use
for the conversion, as follows:
- If
getConverter() returns a non-null Converter ,
use that one, otherwise
- If
Application.createConverter(Class), passing the
current value's class, returns a non-null Converter ,
use that one.
- If the current value is not
null and a Converter
was located, call its getAsString() method to perform
the conversion.
- If the current value is not
null but no Converter
was located, call toString() on the current value to perform
the conversion.
By default, the rendererType property must be set to
"javax.faces.Text". This value can be changed by calling the
setRendererType() method.
| Field Summary |
|---|
| public static final String | COMPONENT_TYPE | The standard component type for this component. |
| public static final String | COMPONENT_FAMILY | The standard component family for this component. |
| Methods from javax.faces.component.UIComponentBase: |
|---|
|
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getDescriptorMap, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, restoreState, saveAttachedState, saveState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding |
| Methods from javax.faces.component.UIComponent: |
|---|
|
addFacesListener, broadcast, decode, encodeAll, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getAttributesThatAreSet, getChildCount, getChildren, getClientId, getContainerClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getFamily, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, getValueExpression, invokeOnComponent, isRendered, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, setId, setParent, setRendered, setRendererType, setValueBinding, setValueExpression |
| Method from javax.faces.component.UIOutput Detail: |
public Converter getConverter() {
if (this.converter != null) {
return (this.converter);
}
ValueExpression ve = getValueExpression("converter");
if (ve != null) {
try {
return ((Converter) ve.getValue(getFacesContext().getELContext()));
}
catch (ELException e) {
throw new FacesException(e);
}
} else {
return (null);
}
}
|
public String getFamily() {
// -------------------------------------------------------------- Properties
return (COMPONENT_FAMILY);
}
|
public Object getLocalValue() {
return (this.value);
}
|
public Object getValue() {
if (this.value != null) {
return (this.value);
}
ValueExpression ve = getValueExpression("value");
if (ve != null) {
try {
return (ve.getValue(getFacesContext().getELContext()));
}
catch (ELException e) {
throw new FacesException(e);
}
} else {
return (null);
}
}
|
public void restoreState(FacesContext context,
Object state) {
values = (Object[]) state;
super.restoreState(context, values[0]);
converter = (Converter) restoreAttachedState(context, values[1]);
value = values[2];
}
|
public Object saveState(FacesContext context) {
if (values == null) {
values = new Object[3];
}
values[0] = super.saveState(context);
values[1] = saveAttachedState(context, converter);
values[2] = value;
return (values);
}
|
public void setConverter(Converter converter) {
this.converter = converter;
}
|
public void setValue(Object value) {
this.value = value;
}
|