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 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 | |
| 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 componentResource)FacesContext for the current requestThe UIComponent representing a
javax.faces.application.Resource instance
Add argument |
| public void | addComponentResource(FacesContext
FacesContext for the current requestThe componentResource, String UIComponent representing a
javax.faces.application.Resource instanceThe name of the facet for which the target)UIComponent will be addedAdd argument |
| public void | addPhaseListener(PhaseListener
the newPhaseListener)PhaseListener to addAdd 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 javax. Generate an identifier for a component. |
| public void | encodeBegin(FacesContext
FacesContext for the response we are creatingOverrides javax.
Override the default |
| public void | encodeChildren(FacesContext
FacesContext for the response we are creatingOverrides javax. If |
| public void | encodeEnd(FacesContext
FacesContext for the response we are creatingOverrides javax. 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 String | getFamily()
Implements abstract javax. 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 javax. 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 javax. 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 processingBroadcast 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 javax. Perform partial processing by calling
|
| public void | processEvent(ComponentSystemEvent
the event)ComponentSystemEvent instance that
is being processed.Overrides javax. Implements javax.
If the argument |
| public void | processRestoreState(FacesContext
the context, Object FacesContext for this requetsthe opaque state object obtained from the state)javax.faces.application.StateManagerOverrides javax. The default
implementation must call |
| public void | processUpdates(FacesContext
FacesContext for the request we are processingOverrides javax. Perform partial processing by calling
|
| public void | processValidators(FacesContext
FacesContext for the request we are processingOverrides javax. Perform partial processing by calling
|
| public void | queueEvent(FacesEvent
FacesEvent to be queuedOverrides javax. Override the default |
| public void | removeComponentResource(FacesContext componentResource)FacesContext for the current requestThe UIComponent representing a
javax.faces.application.Resource instance
Remove argument |
| public void | removeComponentResource(FacesContext
FacesContext for the current requestThe componentResource, String UIComponent representing a
javax.faces.application.Resource instanceThe name of the facet for which the target)UIComponent will be addedRemove 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 javax. Implements javax. 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 javax. Implements javax. 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 | setInView(boolean
ignore the value. isInView)Overrides javax. Overridden to take no action. |
| public void | |
| public void | setRenderKitId(String
The new renderKitId)javax.faces.render.RenderKit identifier,
or null to disassociate this view with any
specific javax.faces.render.RenderKit instanceSet 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)javax.faces.event.SystemEventListener whose javax.faces.event.SystemEventListener#processEvent 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)javax.faces.event.SystemEventListener whose javax.faces.event.SystemEventListener#processEvent method must
be called when events of type systemEventClass are
fired.Remove the listener instance
referenced by argument |