Class UIOutput
- All Implemented Interfaces:
PartialStateHolder,StateHolder,TransientStateHolder,ValueHolder,ComponentSystemEventListener,FacesListener,SystemEventListenerHolder,EventListener
- Direct Known Subclasses:
HtmlBody,HtmlDoctype,HtmlHead,HtmlOutputFormat,HtmlOutputLabel,HtmlOutputLink,HtmlOutputText,UIInput,UIOutcomeTarget
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 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 rendererType property must be set to "jakarta.faces.Text". This value can
be changed by calling the setRendererType() method.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe standard component family for this component.static final StringThe 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, CURRENT_COMPONENT, CURRENT_COMPOSITE_COMPONENT, FACETS_KEY, HONOR_CURRENT_COMPONENT_ATTRIBUTES_PARAM_NAME, VIEW_LOCATION_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidFor each of the attached objects on this instance that implementPartialStateHolder, callPartialStateHolder.clearInitialState()on the attached object.Return theConverter(if any) that is registered for thisUIComponent.Return the identifier of the component family to which this component belongs.Return the local value of thisUIComponent(if any), without evaluating any associatedValueExpression.getValue()Return the value property.voidIn addition to the actions taken inUIComponentBasewhenPartialStateHolder.markInitialState()is called, check if the installedConverteris a PartialStateHolder and if it is, callPartialStateHolder.markInitialState()on it.voidConvenience 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.saveState(FacesContext context) Gets the state of the instance as aSerializableObject.voidsetConverter(Converter converter) Set theConverter(if any) that is registered for thisUIComponent.voidSet 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, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding, subscribeToEvent, unsubscribeFromEventMethods 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 Details
-
COMPONENT_TYPE
The standard component type for this component.
- See Also:
-
COMPONENT_FAMILY
The standard component family for this component.
- See Also:
-
-
Constructor Details
-
UIOutput
public UIOutput()Create a new
UIOutputinstance with default property values.
-
-
Method Details
-
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
Description copied from interface:ValueHolderReturn the
Converter(if any) that is registered for thisUIComponent.- Specified by:
getConverterin interfaceValueHolder- Returns:
- the converter.
-
setConverter
Description copied from interface:ValueHolderSet the
Converter(if any) that is registered for thisUIComponent.- Specified by:
setConverterin interfaceValueHolder- Parameters:
converter- NewConverter(ornull)
-
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
Return the value property.
- Specified by:
getValuein interfaceValueHolder- Returns:
- the value.
- Since:
- 2.2
-
setValue
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
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
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.
-