Class UIOutput
- java.lang.Object
-
- jakarta.faces.component.UIComponent
-
- jakarta.faces.component.UIComponentBase
-
- jakarta.faces.component.UIOutput
-
- All Implemented Interfaces:
PartialStateHolder,StateHolder,TransientStateHolder,ValueHolder,ComponentSystemEventListener,FacesListener,SystemEventListenerHolder,EventListener
- Direct Known Subclasses:
HtmlBody,HtmlDoctype,HtmlHead,HtmlOutputFormat,HtmlOutputLabel,HtmlOutputLink,HtmlOutputText,UIInput,UIOutcomeTarget
public class UIOutput extends UIComponentBase implements ValueHolder
UIOutput is a
UIComponentthat 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 aString, locate aConverter(if any) to use for the conversion, as follows: - If the current value is not
nulland aConverterwas located, call itsgetAsString()method to perform the conversion. - If the current value is not
nullbut noConverterwas located, calltoString()on the current value to perform the conversion.
By default, the
rendererTypeproperty must be set to "jakarta.faces.Text". This value can be changed by calling thesetRendererType()method.
-
-
Field Summary
Fields Modifier and Type Field Description static StringCOMPONENT_FAMILYThe standard component family for this component.static StringCOMPONENT_TYPEThe standard component type for this component.-
Fields inherited from class jakarta.faces.component.UIComponent
ATTRS_WITH_DECLARED_DEFAULT_VALUES, BEANINFO_KEY, bindings, COMPOSITE_COMPONENT_TYPE_KEY, COMPOSITE_FACET_NAME, FACETS_KEY, VIEW_LOCATION_KEY
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearInitialState()For each of the attached objects on this instance that implementPartialStateHolder, callPartialStateHolder.clearInitialState()on the attached object.ConvertergetConverter()Return theConverter(if any) that is registered for thisUIComponent.StringgetFamily()Return the identifier of the component family to which this component belongs.ObjectgetLocalValue()Return the local value of thisUIComponent(if any), without evaluating any associatedValueExpression.ObjectgetValue()Return the value property.voidmarkInitialState()In addition to the actions taken inUIComponentBasewhenPartialStateHolder.markInitialState()is called, check if the installedConverteris a PartialStateHolder and if it is, callPartialStateHolder.markInitialState()on it.voidresetValue()Convenience method to reset this component's value to the un-initialized state.voidrestoreState(FacesContext context, Object state)Perform any processing required to restore the state from the entries in the state Object.ObjectsaveState(FacesContext context)Gets the state of the instance as aSerializableObject.voidsetConverter(Converter converter)Set theConverter(if any) that is registered for thisUIComponent.voidsetValue(Object value)Set the value of thisUIComponent(if any).-
Methods inherited from class jakarta.faces.component.UIComponentBase
addClientBehavior, addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getClientId, getDefaultEventName, getEventNames, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getListenersForEventClass, getParent, getPassThroughAttributes, getRenderer, getRendererType, getRendersChildren, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, subscribeToEvent, unsubscribeFromEvent
-
Methods inherited from class jakarta.faces.component.UIComponent
encodeAll, getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getNamingContainer, getPassThroughAttributes, getResourceBundleMap, getStateHelper, getStateHelper, getTransientStateHelper, getTransientStateHelper, getValueExpression, initialStateMarked, isCompositeComponent, isInView, isVisitable, popComponentFromEL, processEvent, pushComponentToEL, restoreTransientState, saveTransientState, setInView, setValueExpression, visitTree
-
-
-
-
Field Detail
-
COMPONENT_TYPE
public static final String COMPONENT_TYPE
The standard component type for this component.
- See Also:
- Constant Field Values
-
COMPONENT_FAMILY
public static final String COMPONENT_FAMILY
The standard component family for this component.
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
UIOutput
public UIOutput()
Create a new
UIOutputinstance with default property values.
-
-
Method Detail
-
getFamily
public String getFamily()
Description copied from class:UIComponentReturn the identifier of the component family to which this component belongs. This identifier, in conjunction with the value of the
rendererTypeproperty, may be used to select the appropriateRendererfor this component instance. Note this method should NOT returnnull- Specified by:
getFamilyin classUIComponent- Returns:
- the component family (not null).
-
getConverter
public Converter getConverter()
Description copied from interface:ValueHolderReturn the
Converter(if any) that is registered for thisUIComponent.- Specified by:
getConverterin interfaceValueHolder- Returns:
- the converter.
-
setConverter
public void setConverter(Converter converter)
Description copied from interface:ValueHolderSet the
Converter(if any) that is registered for thisUIComponent.- Specified by:
setConverterin interfaceValueHolder- Parameters:
converter- NewConverter(ornull)
-
getLocalValue
public Object getLocalValue()
Description copied from interface:ValueHolderReturn the local value of this
UIComponent(if any), without evaluating any associatedValueExpression.- Specified by:
getLocalValuein interfaceValueHolder- Returns:
- the local value.
-
getValue
public Object getValue()
Return the value property.
- Specified by:
getValuein interfaceValueHolder- Returns:
- the value.
- Since:
- 2.2
-
setValue
public void setValue(Object value)
Description copied from interface:ValueHolderSet the value of this
UIComponent(if any).- Specified by:
setValuein interfaceValueHolder- Parameters:
value- The new local value
-
resetValue
public void resetValue()
Convenience method to reset this component's value to the un-initialized state.
- Since:
- 2.2
-
markInitialState
public void markInitialState()
In addition to the actions taken in
UIComponentBasewhenPartialStateHolder.markInitialState()is called, check if the installedConverteris a PartialStateHolder and if it is, callPartialStateHolder.markInitialState()on it.- Specified by:
markInitialStatein interfacePartialStateHolder- Overrides:
markInitialStatein classUIComponentBase
-
clearInitialState
public void clearInitialState()
Description copied from class:UIComponentBaseFor each of the attached objects on this instance that implement
PartialStateHolder, callPartialStateHolder.clearInitialState()on the attached object.- Specified by:
clearInitialStatein interfacePartialStateHolder- Overrides:
clearInitialStatein classUIComponentBase
-
saveState
public Object saveState(FacesContext context)
Description copied from interface:StateHolderGets the state of the instance as a
SerializableObject.If the class that implements this interface has references to instances that implement StateHolder (such as a
UIComponentwith event handlers, validators, etc.) this method must call theStateHolder.saveState(jakarta.faces.context.FacesContext)method on all those instances as well. This method must not save the state of children and facets. That is done via theStateManagerThis method must not alter the state of the implementing object. In other words, after executing this code:
Object state = component.saveState(facesContext);componentshould be the same as before executing it.The return from this method must be
Serializable- Specified by:
saveStatein interfaceStateHolder- Overrides:
saveStatein classUIComponentBase- Parameters:
context- the Faces context.- Returns:
- the saved state.
-
restoreState
public void restoreState(FacesContext context, Object state)
Description copied from interface:StateHolderPerform any processing required to restore the state from the entries in the state Object.
If the class that implements this interface has references to instances that also implement StateHolder (such as a
UIComponentwith event handlers, validators, etc.) this method must call theStateHolder.restoreState(jakarta.faces.context.FacesContext, java.lang.Object)method on all those instances as well.If the
stateargument isnull, take no action and return.- Specified by:
restoreStatein interfaceStateHolder- Overrides:
restoreStatein classUIComponentBase- Parameters:
context- the Faces context.state- the state.
-
-