|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.faces.component.UIComponent javax.faces.component.UIComponentBase javax.faces.component.UIViewRoot
public class UIViewRoot
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 PhaseListener
s.
For each of the following lifecycle phase methods:
RenderResponse, via encodeBegin(javax.faces.context.FacesContext)
and encodeEnd(javax.faces.context.FacesContext)
Take the following action regarding
PhaseListener
s.
Initialize a state flag to false
.
If getBeforePhaseListener()
returns non-null
,
invoke the listener, passing in the correct corresponding PhaseId
for this phase.
Upon return from the listener, call FacesContext#getResponseComplete
and FacesContext#getRenderResponse
. If either return true
set the internal state flag to true
.
If or one or more listeners have been added by a call to addPhaseListener(javax.faces.event.PhaseListener)
, invoke the beforePhase
method on
each one whose PhaseListener#getPhaseId
matches the current
phaseId, passing in the same PhaseId
as in the previous
step.
Upon return from each listener, call FacesContext#getResponseComplete
and FacesContext#getRenderResponse
. If either return true
set the internal state flag to true
.
Execute any processing for this phase if the internal state flag was not set.
If getAfterPhaseListener()
returns non-null
,
invoke the listener, passing in the correct corresponding PhaseId
for this phase.
If or one or more listeners have been added by a call to addPhaseListener(javax.faces.event.PhaseListener)
, invoke the afterPhase
method on each
one whose PhaseListener#getPhaseId
matches the current
phaseId, passing in the same PhaseId
as in the previous
step.
Field Summary | |
---|---|
static java.lang.String |
COMPONENT_FAMILY
The standard component family for this component. |
static java.lang.String |
COMPONENT_TYPE
The standard component type for this component. |
static java.lang.String |
METADATA_FACET_NAME
|
static java.lang.String |
UNIQUE_ID_PREFIX
The prefix that will be used for identifiers generated by the createUniqueId() method. |
static java.lang.String |
VIEW_PARAMETERS_KEY
The key in the value set of the
view metadata BeanDescriptor, the value of which is a
|
Fields inherited from class javax.faces.component.UIComponent |
---|
BEANINFO_KEY, bindings, COMPOSITE_COMPONENT_TYPE_KEY, COMPOSITE_FACET_NAME, CURRENT_COMPONENT, CURRENT_COMPOSITE_COMPONENT, FACETS_KEY, VIEW_LOCATION_KEY |
Constructor Summary | |
---|---|
UIViewRoot()
Create a new UIViewRoot instance with default property
values. |
Method Summary | |
---|---|
void |
addComponentResource(FacesContext context,
UIComponent componentResource)
Add argument |
void |
addComponentResource(FacesContext context,
UIComponent componentResource,
java.lang.String target)
Add argument |
void |
addPhaseListener(PhaseListener newPhaseListener)
Add the argument newPhaseListener to the list of
PhaseListener s on this UIViewRoot . |
void |
broadcastEvents(FacesContext context,
PhaseId phaseId)
Broadcast any events that have been queued. |
java.lang.String |
createUniqueId()
Generate an identifier for a component. |
java.lang.String |
createUniqueId(FacesContext context,
java.lang.String seed)
Generate an identifier for a component. |
void |
encodeBegin(FacesContext context)
Override the default UIComponentBase#encodeBegin behavior. |
void |
encodeChildren(FacesContext context)
If |
void |
encodeEnd(FacesContext context)
If |
MethodExpression |
getAfterPhaseListener()
Return the MethodExpression that will be invoked after
this view is rendered. |
MethodExpression |
getBeforePhaseListener()
Return the MethodExpression that will be invoked
before this view is rendered. |
java.util.List<UIComponent> |
getComponentResources(FacesContext context,
java.lang.String target)
Return an unmodifiable
|
java.lang.String |
getFamily()
Return the identifier of the component family to which this component belongs. |
java.util.Locale |
getLocale()
Return the Locale to be used in localizing the
response being created for this view. |
java.util.List<PhaseListener> |
getPhaseListeners()
Return an unmodifiable list of the
|
java.lang.String |
getRenderKitId()
Return the render kit identifier of the RenderKit associated with this view. |
boolean |
getRendersChildren()
Call |
java.lang.String |
getViewId()
Return the view identifier for this view. |
java.util.List<SystemEventListener> |
getViewListenersForEventClass(java.lang.Class<? extends SystemEvent> systemEvent)
Return the
|
java.util.Map<java.lang.String,java.lang.Object> |
getViewMap()
This implementation simply calls through to |
java.util.Map<java.lang.String,java.lang.Object> |
getViewMap(boolean create)
Returns a |
boolean |
isInView()
Return |
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)
|
void |
processRestoreState(FacesContext context,
java.lang.Object state)
The default implementation must call
|
void |
processUpdates(FacesContext context)
|
void |
processValidators(FacesContext context)
|
void |
queueEvent(FacesEvent event)
Override the default UIComponentBase#queueEvent behavior to
accumulate the queued events for later broadcasting. |
void |
removeComponentResource(FacesContext context,
UIComponent componentResource)
Remove argument |
void |
removeComponentResource(FacesContext context,
UIComponent componentResource,
java.lang.String target)
Remove argument |
void |
removePhaseListener(PhaseListener toRemove)
If the argument toRemove is in the list of PhaseListener s for this instance, it must be removed. |
void |
restoreState(FacesContext context,
java.lang.Object state)
Perform any processing required to restore the state from the entries in the state Object. |
java.lang.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 |
setInView(boolean isInView)
Overridden to take no action. |
void |
setLocale(java.util.Locale locale)
Set the Locale to be used in localizing the
response being created for this view. |
void |
setRenderKitId(java.lang.String renderKitId)
Set the render kit identifier of the RenderKit
associated with this view. |
void |
setViewId(java.lang.String viewId)
Set the view identifier for this view. |
void |
subscribeToViewEvent(java.lang.Class<? extends SystemEvent> systemEvent,
SystemEventListener listener)
Install the listener instance
referenced by argument |
void |
unsubscribeFromViewEvent(java.lang.Class<? extends SystemEvent> systemEvent,
SystemEventListener listener)
Remove the listener instance
referenced by argument |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String METADATA_FACET_NAME
public static final java.lang.String VIEW_PARAMETERS_KEY
The key in the value set of the
view metadata BeanDescriptor, the value of which is a
List<
.UIViewParameter.Reference
>
public static final java.lang.String COMPONENT_TYPE
The standard component type for this component.
public static final java.lang.String COMPONENT_FAMILY
The standard component family for this component.
public static final java.lang.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 boolean isInView()
Return trues
.
isInView
in class UIComponent
public void setInView(boolean isInView)
Overridden to take no action.
setInView
in class UIComponent
isInView
- public java.lang.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
UIComponent#getFamily()
public java.lang.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(java.lang.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.
renderKitId
- The new RenderKit
identifier,
or null
to disassociate this view with any
specific RenderKit
instancepublic java.lang.String getViewId()
Return the view identifier for this view.
public void setViewId(java.lang.String viewId)
Set the view identifier for this view.
viewId
- The new view identifierpublic MethodExpression getBeforePhaseListener()
Return the MethodExpression
that will be invoked
before this view is rendered.
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
.
newBeforePhase
- the MethodExpression
that will be
invoked before this view is rendered.public MethodExpression getAfterPhaseListener()
Return the MethodExpression
that will be invoked after
this view is rendered.
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 including 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
.
newAfterPhase
- the MethodExpression
that will be
invoked after this view is rendered.public void removePhaseListener(PhaseListener toRemove)
If the argument toRemove
is in the list of PhaseListener
s for this instance, it must be removed.
toRemove
- the PhaseListener
to remove.public void addPhaseListener(PhaseListener newPhaseListener)
Add the argument newPhaseListener
to the list of
PhaseListener
s on this UIViewRoot
.
newPhaseListener
- the PhaseListener
to addpublic java.util.List<PhaseListener> getPhaseListeners()
Return an unmodifiable list of the
PhaseListener
instances attached to this
UIViewRoot
instance.
public void addComponentResource(FacesContext context, UIComponent componentResource)
Add argument component
,
which is assumed to represent a resource instance, as a resource
to this view. A resource instance is rendered by a resource
Renderer
, as described in the Standard HTML
RenderKit. The default implementation must call through to
addComponentResource(javax.faces.context.FacesContext,
javax.faces.component.UIComponent, java.lang.String)
.
context
- FacesContext
for the current requestcomponentResource
- The UIComponent
representing a
Resource
instancepublic void addComponentResource(FacesContext context, UIComponent componentResource, java.lang.String target)
Add argument component
,
which is assumed to represent a resource instance, as a resource
to this view. A resource instance is rendered by a resource
Renderer
, as described in the Standard HTML
RenderKit.
The component
must be added using the following
algorithm:
If the target
argument is null
,
look for a target
attribute on the
component
. If there is no target
attribute, set target
to be the default value
head
Call getComponentResources(javax.faces.context.FacesContext, java.lang.String)
to obtain the child
list for the given target.
If the component ID of componentResource
matches the
the ID of a resource that has allready been added, remove the old
resource.
Add the component
resource to the
list.
context
- FacesContext
for the current requestcomponentResource
- The UIComponent
representing a
Resource
instancetarget
- The name of the facet for which the UIComponent
will be addedpublic java.util.List<UIComponent> getComponentResources(FacesContext context, java.lang.String target)
Return an unmodifiable
List
of UIComponent
s for the provided
target
agrument. Each component
in the
List
is assumed to represent a resource
instance.
The default implementation must use an algorithm equivalent to the the following.
component
by calling getFacet()
using
target
as the argument.context.getApplication().createComponent()
using javax.faces.Panel
as the argumentid
of the facet to be target
Map
using target
as the key
target
- The name of the facet for which the components will be returned.
List
of UIComponent
children of
the facet with the name target
. If no children are
found for the facet, return Collections.emptyList()
.
java.lang.NullPointerException
- if target
or
context
is null
public void removeComponentResource(FacesContext context, UIComponent componentResource)
Remove argument component
,
which is assumed to represent a resource instance, as a resource
to this view.
context
- FacesContext
for the current requestcomponentResource
- The UIComponent
representing a
Resource
instancepublic void removeComponentResource(FacesContext context, UIComponent componentResource, java.lang.String target)
Remove argument component
,
which is assumed to represent a resource instance, as a resource
to this view. A resource instance is rendered by a resource
Renderer
, as described in the Standard HTML
RenderKit.
The component
must be removed using the following algorithm:
target
argument is null
, look for a target
attribute on the component
.target
attribute, set target
to be the default value head
getComponentResources(javax.faces.context.FacesContext, java.lang.String)
to obtain the child list for the
given target.component
resource from the child list.
context
- FacesContext
for the current requestcomponentResource
- The UIComponent
representing a
Resource
instancetarget
- The name of the facet for which the UIComponent
will be addedpublic void queueEvent(FacesEvent event)
Override the default UIComponentBase#queueEvent
behavior to
accumulate the queued events for later broadcasting.
queueEvent
in class UIComponentBase
event
- FacesEvent
to be queued
IllegalStateException
- if this component is not a
descendant of a UIViewRoot
java.lang.NullPointerException
- if event
is null
public void broadcastEvents(FacesContext context, PhaseId phaseId)
Broadcast any events that have been
queued. First broadcast events that have been queued for PhaseId#ANY_PHASE
. Then broadcast ane events that have been
queued for the current phase. In both cases, UIComponent#pushComponentToEL
must be called before the event is
broadcast, and UIComponent#popComponentFromEL
must be
called after the return from the broadcast, even in the case of
an exception.
context
- FacesContext
for the current requestphaseId
- PhaseId
of the current phasepublic void processRestoreState(FacesContext context, java.lang.Object state)
The default implementation must call
UIComponentBase#processRestoreState
from within a
try
block. The try
block must have a
finally
block that ensures that no FacesEvent
s remain in the event queue, and that the
this.
UIComponent#visitTree
is called, passing a
ContextCallback
that takes the following action: call the
UIComponent#processEvent
method of the current
component. The argument event
must be an instance of
PostRestoreStateEvent
whose
component
property is the current component in the
traversal.
processRestoreState
in class UIComponentBase
context
- the FacesContext
for this requetsstate
- the opaque state object obtained from the StateManager
public void processDecodes(FacesContext context)
Perform partial processing by calling
PartialViewContext.processPartial(javax.faces.event.PhaseId)
with
PhaseId#APPLY_REQUEST_VALUES
if:
PartialViewContext.isPartialRequest()
returns true
and we don't have a request to process all
components in the view
(PartialViewContext.isExecuteAll()
returns
false
)UIComponentBase#processDecodes
if one of the following
conditions are met:
PartialViewContext.isPartialRequest()
returns true
and we have a request to process all
components in the view
(PartialViewContext.isExecuteAll()
returns
true
)PartialViewContext.isPartialRequest()
returns false
Override the default
UIComponentBase#processDecodes
behavior to broadcast any queued
events after the default processing or partial 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
java.lang.NullPointerException
- if context
is null
public void encodeBegin(FacesContext context) throws java.io.IOException
Override the default
UIComponentBase#encodeBegin
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
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
java.io.IOException
- if an input/output error occurs while renderingpublic void encodeChildren(FacesContext context) throws java.io.IOException
If PartialViewContext.isAjaxRequest()
returns
true
, perform partial rendering by calling
PartialViewContext.processPartial(javax.faces.event.PhaseId)
with
PhaseId#RENDER_RESPONSE
. If PartialViewContext.isAjaxRequest()
returns
false
, delegate to the parent UIComponentBase.encodeChildren(javax.faces.context.FacesContext)
method.
encodeChildren
in class UIComponentBase
context
- FacesContext
for the response we are creating
java.io.IOException
- if an input/output error occurs while renderingpublic void encodeEnd(FacesContext context) throws java.io.IOException
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. If the current view has view
parameters, as indicated by a non-empty and
non-UnsupportedOperationException
throwing return
from ViewDeclarationLanguage.getViewMetadata(javax.faces.context.FacesContext, String)
,
call UIViewParameter#encodeAll
on each parameter. If
calling getViewParameters()
causes
UnsupportedOperationException
to be thrown, the
exception must be silently swallowed.
encodeEnd
in class UIComponentBase
context
- FacesContext
for the response we are creating
java.io.IOException
- if an input/output error occurs while renderingpublic boolean getRendersChildren()
Call UIComponentBase#getRendersChildren
If PartialViewContext.isAjaxRequest()
returns true
this method must return true
.
getRendersChildren
in class UIComponentBase
public void processValidators(FacesContext context)
Perform partial processing by calling
PartialViewContext.processPartial(javax.faces.event.PhaseId)
with
PhaseId#PROCESS_VALIDATIONS
if:
PartialViewContext.isPartialRequest()
returns true
and we don't have a request to process all
components in the view
(PartialViewContext.isExecuteAll()
returns
false
)UIComponentBase#processValidators
if one of the following
conditions are met:
PartialViewContext.isPartialRequest()
returns true
and we have a request to process all
components in the view
(PartialViewContext.isExecuteAll()
returns
true
)PartialViewContext.isPartialRequest()
returns false
Override the default
UIComponentBase#processValidators
behavior to broadcast any
queued events after the default processing or partial 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
java.lang.NullPointerException
- if context
is null
public void processUpdates(FacesContext context)
Perform partial processing by calling
PartialViewContext.processPartial(javax.faces.event.PhaseId)
with
PhaseId#UPDATE_MODEL_VALUES
if:
PartialViewContext.isPartialRequest()
returns true
and we don't have a request to process all
components in the view
(PartialViewContext.isExecuteAll()
returns
false
)UIComponentBase#processUpdates
if one of the following
conditions are met:
PartialViewContext.isPartialRequest()
returns true
and we have a request to process all
components in the view
(PartialViewContext.isExecuteAll()
returns
true
)PartialViewContext.isPartialRequest()
returns false
Override the default UIComponentBase
behavior to broadcast any queued events after the default processing or
partial 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
java.lang.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
java.lang.NullPointerException
- if context
is null
public java.lang.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 java.lang.String createUniqueId(FacesContext context, java.lang.String seed)
Generate an identifier for a component. The identifier will be prefixed with UNIQUE_ID_PREFIX, and will be unique within this UIViewRoot. Optionally, a unique seed value can be supplied by component creators which should be included in the generated unique id.
createUniqueId
in interface UniqueIdVendor
context
- FacesContextseed
- an optional seed value - e.g. based on the position of the component in the VDL-template
public java.util.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(java.util.Locale locale)
Set the Locale
to be used in localizing the
response being created for this view.
locale
- The new localization Localepublic java.util.Map<java.lang.String,java.lang.Object> getViewMap()
This implementation simply calls through to getViewMap(boolean)
, passing true
as the argument, and
returns the result.
public java.util.Map<java.lang.String,java.lang.Object> getViewMap(boolean create)
Returns a Map
that acts as the
interface to the data store that is the "view scope", or, if this
instance does not have such a Map
and the
create
argument is true
, creates one and
returns it. This map must be instantiated lazily and cached for return
from subsequent calls to this method on this UIViewRoot
instance. Application.publishEvent(javax.faces.context.FacesContext, java.lang.Class extends javax.faces.event.SystemEvent>, java.lang.Object)
must
be called, passing PostConstructViewMapEvent
.class
as the
first argument and this UIViewRoot
instance as the second
argument.
The returned Map
must be implemented such that calling
clear()
on the Map
causes Application.publishEvent(javax.faces.context.FacesContext, java.lang.Class extends javax.faces.event.SystemEvent>, java.lang.Object)
to be
called, passing PreDestroyViewMapEvent
.class
as the first argument and this UIViewRoot
instance
as the second argument.
See FacesContext#setViewRoot
for the specification of when the
clear()
method must be called.
create
- true
to create a new Map
for this
instance if necessary; false
to return
null
if there's no current Map
.public void subscribeToViewEvent(java.lang.Class<? extends SystemEvent> systemEvent, SystemEventListener listener)
Install the listener instance
referenced by argument listener
into the
UIViewRoot
as a listener for events of type
systemEventClass
.
Note that installed listeners are not maintained as part of the
UIViewRoot
's state.
systemEvent
- the Class
of event for which
listener
must be fired.listener
- the implementation of SystemEventListener
whose SystemEventListener.processEvent(javax.faces.event.SystemEvent)
method must
be called when events of type systemEventClass
are
fired.
NullPointerException
- if systemEventClass
or listener
are null
.public void unsubscribeFromViewEvent(java.lang.Class<? extends SystemEvent> systemEvent, SystemEventListener listener)
Remove the listener instance
referenced by argument listener
from the
UIViewRoot
as a listener for events of type
systemEventClass
.
systemEvent
- the Class
of event for which
listener
must be fired.listener
- the implementation of SystemEventListener
whose SystemEventListener.processEvent(javax.faces.event.SystemEvent)
method must
be called when events of type systemEventClass
are
fired.
NullPointerException
- if
systemEventClass
or listener
are
null
.public java.util.List<SystemEventListener> getViewListenersForEventClass(java.lang.Class<? extends SystemEvent> systemEvent)
Return the
SystemEventListener
instances registered on this
UIComponent
instance that are interested in events
of type eventClass
.
systemEvent
- the Class
of event for which the
listeners must be returned.
java.lang.NullPointerException
- if argument systemEvent
is null
.public java.lang.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, java.lang.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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2009, 2010, Oracle Corporation and/or its affiliates. All Rights Reserved. Use is subject to license terms.
Generated on 4-June-2010 04:34