UIViewRoot is the UIComponent that represents the root of
the UIComponent tree. This component renders markup as the response to Ajax requests. It also serves as the root of
the component tree, and as a place to hang per-view PhaseListeners.
For each of the following lifecycle phase methods:
RenderResponse, via encodeBegin and encodeEnd
Take the following action regarding PhaseListeners.
Initialize a state flag to
false.If
getBeforePhaseListenerreturns non-null, invoke the listener, passing in the correct correspondingPhaseIdfor this phase.Upon return from the listener, call
FacesContext#getResponseCompleteandFacesContext#getRenderResponse. If either returntrueset the internal state flag totrue.If or one or more listeners have been added by a call to
addPhaseListener, invoke thebeforePhasemethod on each one whosePhaseListener#getPhaseIdmatches the current phaseId, passing in the samePhaseIdas in the previous step.Upon return from each listener, call
FacesContext#getResponseCompleteandFacesContext#getRenderResponse. If either returntrueset the internal state flag totrue.Execute any processing for this phase if the internal state flag was not set.
If
getAfterPhaseListenerreturns non-null, invoke the listener, passing in the correct correspondingPhaseIdfor this phase.If or one or more listeners have been added by a call to
addPhaseListener, invoke theafterPhasemethod on each one whosePhaseListener#getPhaseIdmatches the current phaseId, passing in the samePhaseIdas in the previous step.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| pack-priv static enum | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | beforeMethodException
Set and cleared during the lifetime of a lifecycle phase. |
| public static final String | COMPONENT_FAMILY
The standard component family for this component. |
| public static final String | COMPONENT_TYPE
The standard component type for this component. |
| private Doctype | doctype
Set during view build time. |
| private List | events
An array of Lists of events that have been queued for later broadcast, with one List for each lifecycle phase. |
| private static Lifecycle | |
| private static final Map | |
| private static final String | |
| private static final Logger | |
| public static final String | METADATA_FACET_NAME
The key in the facet collection that contains the meta data of the view root. |
| private ListIterator | phaseListenerIterator
Set and cleared during the lifetime of a lifecycle phase. |
| private boolean | skipPhase
Set and cleared during the lifetime of a lifecycle phase. |
| public static final String | UNIQUE_ID_PREFIX
The prefix that will be used for identifiers generated by the |
| private Object[] | |
| public static final String | VIEW_PARAMETERS_KEY
The key in the value set of the view metadata BeanDescriptor, the value of which is a
|
| pack-priv Map | |
| public static final String | VIEWROOT_PHASE_LISTENER_QUEUES_EXCEPTIONS_PARAM_NAME
If this param is set, and calling toLowerCase().equals("true") on a String representation of its value returns true,
exceptions thrown by |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addComponentResource(FacesContext
FacesContext for the current requestThe componentResource)UIComponent representing a jakarta. instance
Add argument |
| public void | addComponentResource(FacesContext
FacesContext for the current requestThe componentResource, String UIComponent representing a jakarta. instanceThe name of the facet for which the target)UIComponent will be added
Add argument |
| public void | addPhaseListener(PhaseListener
the newPhaseListener)PhaseListener to add
Add the argument |
| public void | broadcastEvents(FacesContext
FacesContext for the current requestPhaseId of the current phaseBroadcast any events that have been queued. |
| private void | |
| private static PhaseEvent | |
| public String | |
| public String | Returns: a unique-id in this component-containerFacesContext context, String an optional seed value - e.g. based on the position of the component in the VDL-template seed)Implements jakarta. Generate an identifier for a component. |
| public void | encodeBegin(FacesContext
FacesContext for the response we are creatingOverrides jakarta.
Override the default |
| public void | encodeChildren(FacesContext
FacesContext for the response we are creatingOverrides jakarta.
If |
| public void | encodeEnd(FacesContext
FacesContext for the response we are creatingOverrides jakarta.
If |
| private void | |
| public MethodExpression | Returns: theMethodExpression that will be invoked after this view is rendered.
Return the |
| public MethodExpression | Returns: theMethodExpression that will be invoked before this view is rendered.
Return the |
| public List | Returns: AList of UIComponent children of the facet with the name target. If no
children are found for the facet, return Collections.emptyList().the Faces context. context, String The name of the facet for which the components will be returned. target)
Return an unmodifiable |
| public List | Returns: AList of all UIComponent resources of all supported targets. If no resources are found,
return an empty List.The Faces context. context)
Return an unmodifiable ordered |
| private List | |
| public Doctype | |
| public String | getFamily()
Implements abstract jakarta. Return the identifier of the component family to which this component belongs. |
| private static String | |
| public Locale | Returns: The currentLocale obtained by executing the above algorithm.
Return the |
| private static Locale | |
| public List | Returns: the list of phase listeners.
Return an unmodifiable list of the |
| public String | Returns: the render kit id, ornull.
Return the render kit identifier of the |
| public boolean | getRendersChildren()
Overrides jakarta.
Call |
| public String | |
| public List | Returns: Collection of view listeners.the systemEvent)Class of event for which the listeners must be returned.
Return the |
| public Map | Returns: the view map, ornull.
This implementation simply calls through to |
| public Map | Returns: the view map, ornull.true to create a new Map for this instance if necessary; false
to return null if there's no current Map.
Returns a |
| private static int | Returns: starting atfromIndex, the index of the first occurrence of any substring from set
in toSearch, or -1 if no such match is foundlocal string str, char[] the substring set, int starting index fromIndex)
|
| private void | |
| public boolean | isInView()
Overrides jakarta.
Override superclass method to always return |
| private void | |
| private void | |
| private void | notifyPhaseListeners(FacesContext
the context for this request context, PhaseId the phaseId, boolean PhaseId of the current phaseif true, notify beforePhase listeners. Notify afterPhase listeners otherwise. isBefore)Utility method that notifies phaseListeners for the given phaseId. |
| public void | processApplication(FacesContext
FacesContext for the request we are processing
Broadcast any events that have been queued for the Invoke Application phase of the request processing
lifecycle and to clear out any events for later phases if the event processing for this phase caused
|
| public void | processDecodes(FacesContext
FacesContext for the request we are processingOverrides jakarta.
Perform partial processing by calling
|
| public void | processEvent(ComponentSystemEvent
the event)ComponentSystemEvent instance that is being processed.Overrides jakarta. Implements jakarta.
If the argument |
| public void | processRestoreState(FacesContext
the context, Object FacesContext for this requetsthe opaque state object obtained from the state)jakarta.Overrides jakarta.
The default implementation must call
|
| public void | processUpdates(FacesContext
FacesContext for the request we are processingOverrides jakarta.
Perform partial processing by calling
|
| public void | processValidators(FacesContext
FacesContext for the request we are processingOverrides jakarta.
Perform partial processing by calling
|
| public void | queueEvent(FacesEvent
FacesEvent to be queuedOverrides jakarta.
Override the default |
| public void | removeComponentResource(FacesContext
FacesContext for the current requestThe componentResource)UIComponent representing a jakarta. instance
Remove argument |
| public void | removeComponentResource(FacesContext
FacesContext for the current requestThe componentResource, String UIComponent representing a jakarta. instanceThe name of the facet for which the target)UIComponent will be added
Remove argument |
| public void | removePhaseListener(PhaseListener
the toRemove)PhaseListener to remove.
If the argument |
| public void | resetValues(FacesContext
the context, Collection<String> FacesContext for the request we are processing.The client ids to be visited, on which the described action will be taken. clientIds)
Visit the clientIds and, if the component is an instance of |
| public void | restoreState(FacesContext
the Faces context. context, Object the state. state)Overrides jakarta. Implements jakarta. Perform any processing required to restore the state from the entries in the state Object. |
| public void | restoreViewScopeState(FacesContext
current FacesContext. context, Object the state object. state)Restore ViewScope state. |
| public Object | saveState(FacesContext
the Faces context. context)Overrides jakarta. Implements jakarta.
Gets the state of the instance as a |
| public void | setAfterPhaseListener(MethodExpression
the newAfterPhase)MethodExpression that will be invoked after this view is rendered.Allow an arbitrary method to be called for the "afterPhase" event as the UIViewRoot runs through its lifecycle. |
| public void | setBeforePhaseListener(MethodExpression
the newBeforePhase)MethodExpression that will be invoked before this view is rendered.Allow an arbitrary method to be called for the "beforePhase" event as the UIViewRoot runs through its lifecycle. |
| public void | |
| public void | setInView(boolean
ignore the value. isInView)Overrides jakarta. Overridden to take no action. |
| public void | |
| public void | setRenderKitId(String
The new renderKitId)jakarta. identifier, or null to disassociate
this view with any specific jakarta. instance
Set the render kit identifier of the |
| public void | |
| public void | subscribeToViewEvent(Class<? extends SystemEvent>
the systemEvent, SystemEventListener Class of event for which listener must be fired.the implementation of listener)jakarta. whose
jakarta. method must be called when events of type
systemEventClass are fired.
Install the listener instance referenced by argument |
| public void | unsubscribeFromViewEvent(Class<? extends SystemEvent>
the systemEvent, SystemEventListener Class of event for which listener must be fired.the implementation of listener)jakarta. whose
jakarta. method must be called when events of type
systemEventClass are fired.
Remove the listener instance referenced by argument |