- java.lang.Object
-
- javax.faces.component.UIComponent
-
- javax.faces.component.UIComponentBase
-
- javax.faces.component.UIOutput
-
- All Implemented Interfaces:
- EventListener, PartialStateHolder, StateHolder, TransientStateHolder, ValueHolder, ComponentSystemEventListener, FacesListener, SystemEventListenerHolder
- Direct Known Subclasses:
- HtmlBody, HtmlDoctype, HtmlHead, HtmlOutputFormat, HtmlOutputLabel, HtmlOutputLink, HtmlOutputText, UIInput, UIOutcomeTarget
public class UIOutput extends UIComponentBase implements ValueHolder
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
null
and aConverter
was located, call itsgetAsString()
method to perform the conversion. - If the current value is not
null
but noConverter
was located, calltoString()
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 thesetRendererType()
method.
-
-
Field Summary
Fields Modifier and Type Field and Description static String
COMPONENT_FAMILY
The standard component family for this component.static String
COMPONENT_TYPE
The standard component type for this component.-
Fields inherited from class javax.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 Constructor and Description UIOutput()
Create a newUIOutput
instance with default property values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
clearInitialState()
For each of the attached objects on this instance that implement
PartialStateHolder
, callPartialStateHolder.clearInitialState()
on the attached object.Converter
getConverter()
Return theConverter
(if any) that is registered for thisUIComponent
.String
getFamily()
Return the identifier of the component family to which this component belongs.Object
getLocalValue()
Return the local value of thisUIComponent
(if any), without evaluating any associatedValueExpression
.Object
getValue()
Return the value property.
void
markInitialState()
In addition to the actions taken inUIComponentBase
whenPartialStateHolder.markInitialState()
is called, check if the installedConverter
is a PartialStateHolder and if it is, callPartialStateHolder.markInitialState()
on it.void
resetValue()
Convenience method to reset this component's value to the un-initialized state.
void
restoreState(FacesContext context, Object state)
Perform any processing required to restore the state from the entries in the state Object.Object
saveState(FacesContext context)
Gets the state of the instance as aSerializable
Object.void
setConverter(Converter converter)
Set theConverter
(if any) that is registered for thisUIComponent
.void
setValue(Object value)
Set the value of thisUIComponent
(if any).-
Methods inherited from class javax.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, unsubscribeFromEvent
-
Methods inherited from class javax.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
UIOutput
instance with default property values.
-
-
Method Detail
-
getFamily
public String getFamily()
Description copied from class:UIComponent
Return the identifier of the component family to which this component belongs. This identifier, in conjunction with the value of the
rendererType
property, may be used to select the appropriateRenderer
for this component instance.- Specified by:
getFamily
in classUIComponent
-
getConverter
public Converter getConverter()
Description copied from interface:ValueHolder
Return the
Converter
(if any) that is registered for thisUIComponent
.- Specified by:
getConverter
in interfaceValueHolder
-
setConverter
public void setConverter(Converter converter)
Description copied from interface:ValueHolder
Set the
Converter
(if any) that is registered for thisUIComponent
.- Specified by:
setConverter
in interfaceValueHolder
- Parameters:
converter
- NewConverter
(ornull
)
-
getLocalValue
public Object getLocalValue()
Description copied from interface:ValueHolder
Return the local value of this
UIComponent
(if any), without evaluating any associatedValueExpression
.- Specified by:
getLocalValue
in interfaceValueHolder
-
getValue
public Object getValue()
Return the value property.
- Specified by:
getValue
in interfaceValueHolder
- Since:
- 2.2
-
setValue
public void setValue(Object value)
Description copied from interface:ValueHolder
Set the value of this
UIComponent
(if any).- Specified by:
setValue
in 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
UIComponentBase
whenPartialStateHolder.markInitialState()
is called, check if the installedConverter
is a PartialStateHolder and if it is, callPartialStateHolder.markInitialState()
on it.- Specified by:
markInitialState
in interfacePartialStateHolder
- Overrides:
markInitialState
in classUIComponentBase
-
clearInitialState
public void clearInitialState()
Description copied from class:UIComponentBase
For each of the attached objects on this instance that implement
PartialStateHolder
, callPartialStateHolder.clearInitialState()
on the attached object.- Specified by:
clearInitialState
in interfacePartialStateHolder
- Overrides:
clearInitialState
in classUIComponentBase
-
saveState
public Object saveState(FacesContext context)
Description copied from interface:StateHolder
Gets the state of the instance as a
Serializable
Object.If the class that implements this interface has references to instances that implement StateHolder (such as a
UIComponent
with event handlers, validators, etc.) this method must call theStateHolder.saveState(javax.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 theStateManager
This method must not alter the state of the implementing object. In other words, after executing this code:
Object state = component.saveState(facesContext);
component
should be the same as before executing it.The return from this method must be
Serializable
- Specified by:
saveState
in interfaceStateHolder
- Overrides:
saveState
in classUIComponentBase
-
restoreState
public void restoreState(FacesContext context, Object state)
Description copied from interface:StateHolder
Perform 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
UIComponent
with event handlers, validators, etc.) this method must call theStateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object)
method on all those instances as well.If the
state
argument isnull
, take no action and return.- Specified by:
restoreState
in interfaceStateHolder
- Overrides:
restoreState
in classUIComponentBase
-
-
Nederlandse vertaling
U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.
Bij voorbaat dank.
Document heeft de 11/06/2005 gemaakt, de laatste keer de 18/08/2025 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-javaee-rf-javax/faces/component/uioutput.html
De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.
Referenties
Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur van deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.