|
Préférences
Moteurs de recherche
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
JavaTM Platform, Enterprise Edition, v 5.0
javax.faces.component
|
Field Summary | |
---|---|
static String |
COMPONENT_FAMILY
The standard component family for this component. |
static String |
COMPONENT_TYPE
The standard component type for this component. |
static String |
UNIQUE_ID_PREFIX
The prefix that will be used for identifiers generated by the createUniqueId() method. |
Fields inherited from class javax.faces.component.UIComponent |
---|
bindings |
Constructor Summary | |
---|---|
UIViewRoot()
Create a new UIViewRoot instance with default property
values. |
Method Summary | |
---|---|
void |
addPhaseListener(PhaseListener newPhaseListener)
|
String |
createUniqueId()
Generate an identifier for a component. |
void |
encodeBegin(FacesContext context)
Override the default UIComponentBase.encodeBegin(javax.faces.context.FacesContext)
behavior. |
void |
encodeEnd(FacesContext context)
Override the default UIComponentBase.encodeEnd(javax.faces.context.FacesContext)
behavior. |
MethodExpression |
getAfterPhaseListener()
|
MethodExpression |
getBeforePhaseListener()
|
String |
getFamily()
Return the identifier of the component family to which this component belongs. |
Locale |
getLocale()
Return the Locale to be used in localizing the
response being created for this view. |
String |
getRenderKitId()
Return the render kit identifier of the RenderKit
associated with this view. |
String |
getViewId()
Return the view identifier for this view. |
void |
processApplication(FacesContext context)
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 FacesContext.renderResponse() or
FacesContext.responseComplete() to be called. |
void |
processDecodes(FacesContext context)
Override the default UIComponentBase.processDecodes(javax.faces.context.FacesContext)
behavior to broadcast any queued events after the default
processing has been completed and to clear out any events
for later phases if the event processing for this phase caused FacesContext.renderResponse() or FacesContext.responseComplete()
to be called. |
void |
processUpdates(FacesContext context)
Override the default UIComponentBase behavior to broadcast
any queued events after the default processing has been completed
and to clear out any events for later phases if the event processing
for this phase caused FacesContext.renderResponse() or
FacesContext.responseComplete() to be called. |
void |
processValidators(FacesContext context)
Override the default UIComponentBase.processValidators(javax.faces.context.FacesContext)
behavior to broadcast any queued events after the default
processing has been completed and to clear out any events
for later phases if the event processing for this phase caused FacesContext.renderResponse() or FacesContext.responseComplete()
to be called. |
void |
queueEvent(FacesEvent event)
Override the default UIComponentBase.queueEvent(javax.faces.event.FacesEvent) behavior to
accumulate the queued events for later broadcaster. |
void |
removePhaseListener(PhaseListener toRemove)
|
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 a Serializable Object. |
void |
setAfterPhaseListener(MethodExpression newAfterPhase)
Allow an arbitrary method to be called for the "afterPhase" event as the UIViewRoot runs through its lifecycle. |
void |
setBeforePhaseListener(MethodExpression newBeforePhase)
Allow an arbitrary method to be called for the "beforePhase" event as the UIViewRoot runs through its lifecycle. |
void |
setLocale(Locale locale)
Set the Locale to be used in localizing the
response being created for this view. |
void |
setRenderKitId(String renderKitId)
Set the render kit identifier of the RenderKit
associated with this view. |
void |
setViewId(String viewId)
Set the view identifier for this view. |
Methods inherited from class javax.faces.component.UIComponent |
---|
encodeAll, getContainerClientId |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String COMPONENT_TYPE
The standard component type for this component.
public static final String COMPONENT_FAMILY
The standard component family for this component.
public static final String UNIQUE_ID_PREFIX
The prefix that will be used for identifiers generated
by the createUniqueId()
method.
Constructor Detail |
---|
public UIViewRoot()
Create a new UIViewRoot
instance with default property
values.
Method Detail |
---|
public String getFamily()
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 appropriate Renderer
for this component instance.
getFamily
in class UIComponent
public String getRenderKitId()
Return the render kit identifier of the RenderKit
associated with this view. Unless explicitly set, as in ViewHandler.createView(javax.faces.context.FacesContext, java.lang.String)
, the returned
value will be null.
public void setRenderKitId(String renderKitId)
Set the render kit identifier of the RenderKit
associated with this view. This method may be called at any time
between the end of Apply Request Values phase of the
request processing lifecycle (i.e. when events are being broadcast)
and the beginning of the Render Response phase.
public String getViewId()
Return the view identifier for this view.
public void setViewId(String viewId)
Set the view identifier for this view.
viewId
- The new view identifierpublic MethodExpression getBeforePhaseListener()
MethodExpression
that will be invoked before
this view is rendered.public void setBeforePhaseListener(MethodExpression newBeforePhase)
Allow an arbitrary method to be called for the "beforePhase"
event as the UIViewRoot runs through its lifecycle. This method
will be called for all phases except PhaseId.RESTORE_VIEW
. Unlike a true PhaseListener
,
this approach doesn't allow for only receiving PhaseEvent
s for a given phase.
The method must conform to the signature of PhaseListener.beforePhase(javax.faces.event.PhaseEvent)
.
newBeforePhase
- the MethodExpression
that will be
invoked before this view is rendered.public MethodExpression getAfterPhaseListener()
MethodExpression
that will be invoked after
this view is rendered.public void setAfterPhaseListener(MethodExpression newAfterPhase)
Allow an arbitrary method to be called for the "afterPhase"
event as the UIViewRoot runs through its lifecycle. This method
will be called for all phases except PhaseId.RESTORE_VIEW
. Unlike a true PhaseListener
,
this approach doesn't allow for only receiving PhaseEvent
s for a given phase.
The method must conform to the signature of PhaseListener.afterPhase(javax.faces.event.PhaseEvent)
.
newAfterPhase
- the MethodExpression
that will be
invoked after this view is rendered.public void removePhaseListener(PhaseListener toRemove)
public void addPhaseListener(PhaseListener newPhaseListener)
public void queueEvent(FacesEvent event)
Override the default UIComponentBase.queueEvent(javax.faces.event.FacesEvent)
behavior to
accumulate the queued events for later broadcaster.
queueEvent
in class UIComponentBase
event
- FacesEvent
to be queued
IllegalStateException
- if this component is not a
descendant of a UIViewRoot
NullPointerException
- if event
is null
public void processDecodes(FacesContext context)
Override the default UIComponentBase.processDecodes(javax.faces.context.FacesContext)
behavior to broadcast any queued events after the default
processing has been completed and to clear out any events
for later phases if the event processing for this phase caused FacesContext.renderResponse()
or FacesContext.responseComplete()
to be called.
processDecodes
in class UIComponentBase
context
- FacesContext
for the request we are processing
NullPointerException
- if context
is null
public void encodeBegin(FacesContext context) throws IOException
Override the default UIComponentBase.encodeBegin(javax.faces.context.FacesContext)
behavior. If
getBeforePhaseListener()
returns non-null
,
invoke it, passing a PhaseEvent
for the PhaseId.RENDER_RESPONSE
phase. If the internal list populated
by calls to addPhaseListener(javax.faces.event.PhaseListener)
is non-empty, any listeners
in that list must have their PhaseListener.beforePhase(javax.faces.event.PhaseEvent)
method called, passing the PhaseEvent
. Any errors
that occur during invocation of any of the the beforePhase
listeners must be logged and swallowed. After listeners are invoked
call superclass processing.
encodeBegin
in class UIComponentBase
context
- FacesContext
for the response we are creating
IOException
- if an input/output error occurs while renderingpublic void encodeEnd(FacesContext context) throws IOException
Override the default UIComponentBase.encodeEnd(javax.faces.context.FacesContext)
behavior. If getAfterPhaseListener()
returns
non-null
, invoke it, passing a PhaseEvent
for the PhaseId.RENDER_RESPONSE
phase. Any errors that
occur during invocation of the afterPhase listener must be
logged and swallowed.
encodeEnd
in class UIComponentBase
context
- FacesContext
for the response we are creating
IOException
- if an input/output error occurs while renderingpublic void processValidators(FacesContext context)
Override the default UIComponentBase.processValidators(javax.faces.context.FacesContext)
behavior to broadcast any queued events after the default
processing has been completed and to clear out any events
for later phases if the event processing for this phase caused FacesContext.renderResponse()
or FacesContext.responseComplete()
to be called.
processValidators
in class UIComponentBase
context
- FacesContext
for the request we are processing
NullPointerException
- if context
is null
public void processUpdates(FacesContext context)
Override the default UIComponentBase
behavior to broadcast
any queued events after the default processing has been completed
and to clear out any events for later phases if the event processing
for this phase caused FacesContext.renderResponse()
or
FacesContext.responseComplete()
to be called.
processUpdates
in class UIComponentBase
context
- FacesContext
for the request we are processing
NullPointerException
- if context
is null
public void processApplication(FacesContext context)
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 FacesContext.renderResponse()
or
FacesContext.responseComplete()
to be called.
context
- FacesContext
for the request we are processing
NullPointerException
- if context
is null
public String createUniqueId()
Generate an identifier for a component. The identifier will be prefixed with UNIQUE_ID_PREFIX, and will be unique within this UIViewRoot.
public Locale getLocale()
Return the Locale
to be used in localizing the
response being created for this view.
Algorithm:
If we have a locale
ivar, return it. If we have
a value expression for "locale", get its value. If the value is
null
, return the result of calling ViewHandler.calculateLocale(javax.faces.context.FacesContext)
. If the
value is an instance of java.util.Locale
return it.
If the value is a String, convert it to a
java.util.Locale
and return it. If there is no
value expression for "locale", return the result of calling ViewHandler.calculateLocale(javax.faces.context.FacesContext)
.
Locale
obtained by executing the
above algorithm.public void setLocale(Locale locale)
Set the Locale
to be used in localizing the
response being created for this view.
locale
- The new localization Localepublic Object saveState(FacesContext context)
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 the StateHolder.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 the StateManager
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
saveState
in interface StateHolder
saveState
in class UIComponentBase
public void restoreState(FacesContext context, Object state)
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 the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object)
method on all those
instances as well.
restoreState
in interface StateHolder
restoreState
in class UIComponentBase