Class StateManagerWrapper
- All Implemented Interfaces:
FacesWrapper<StateManager>
Provides a simple implementation of StateManager
that can
be subclassed by developers wishing to provide specialized behavior
to an existing StateManager
instance. The default
implementation of all methods is to call through to the wrapped
StateManager
.
Usage: extend this class and push the implementation being wrapped to the
constructor and use getWrapped()
to access the instance being wrapped.
- Since:
- 1.2
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.faces.application.StateManager
StateManager.SerializedView
-
Field Summary
Fields inherited from class javax.faces.application.StateManager
FULL_STATE_SAVING_VIEW_IDS_PARAM_NAME, IS_BUILDING_INITIAL_STATE, IS_SAVING_STATE, PARTIAL_STATE_SAVING_PARAM_NAME, SERIALIZE_SERVER_STATE_PARAM_NAME, STATE_SAVING_METHOD_CLIENT, STATE_SAVING_METHOD_PARAM_NAME, STATE_SAVING_METHOD_SERVER
-
Constructor Summary
ConstructorDescriptionDeprecated.Use the other constructor taking the implementation being wrapped.StateManagerWrapper
(StateManager wrapped) If this state manager has been decorated, the implementation doing the decorating should push the implementation being wrapped to this constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected Object
getComponentStateToSave
(FacesContext context) The default behavior of this method is to callStateManager.getComponentStateToSave(javax.faces.context.FacesContext)
on the wrappedStateManager
object.protected Object
getTreeStructureToSave
(FacesContext context) The default behavior of this method is to callStateManager.getTreeStructureToSave(javax.faces.context.FacesContext)
on the wrappedStateManager
object.getViewState
(FacesContext context) The default behavior of this method is to callStateManager.getViewState(javax.faces.context.FacesContext)
on the wrappedStateManager
object.A class that implements this interface uses this method to return an instance of the class being wrapped.boolean
isSavingStateInClient
(FacesContext context) The default behavior of this method is to callStateManager.isSavingStateInClient(javax.faces.context.FacesContext)
on the wrappedStateManager
object.protected void
restoreComponentState
(FacesContext context, UIViewRoot viewRoot, String renderKitId) The default behavior of this method is to callStateManager.restoreComponentState(javax.faces.context.FacesContext, javax.faces.component.UIViewRoot, String)
on the wrappedStateManager
object.protected UIViewRoot
restoreTreeStructure
(FacesContext context, String viewId, String renderKitId) The default behavior of this method is to callStateManager.restoreTreeStructure(javax.faces.context.FacesContext, String, String)
on the wrappedStateManager
object.restoreView
(FacesContext context, String viewId, String renderKitId) The default behavior of this method is to callStateManager.restoreView(javax.faces.context.FacesContext, String, String)
on the wrappedStateManager
object.saveSerializedView
(FacesContext context) The default behavior of this method is to callStateManager.saveSerializedView(javax.faces.context.FacesContext)
on the wrappedStateManager
object.saveView
(FacesContext context) The default behavior of this method is to callStateManager.saveView(javax.faces.context.FacesContext)
on the wrappedStateManager
object.void
writeState
(FacesContext context, Object state) The default behavior of this method is to callStateManager.writeState(javax.faces.context.FacesContext, java.lang.Object)
on the wrappedStateManager
object.void
writeState
(FacesContext context, StateManager.SerializedView state) The default behavior of this method is to callStateManager.writeState(javax.faces.context.FacesContext, javax.faces.application.StateManager.SerializedView)
on the wrappedStateManager
object.
-
Constructor Details
-
StateManagerWrapper
Deprecated.Use the other constructor taking the implementation being wrapped. -
StateManagerWrapper
If this state manager has been decorated, the implementation doing the decorating should push the implementation being wrapped to this constructor. The
getWrapped()
will then return the implementation being wrapped.- Parameters:
wrapped
- The implementation being wrapped.- Since:
- 2.3
-
-
Method Details
-
getWrapped
Description copied from interface:FacesWrapper
A class that implements this interface uses this method to return an instance of the class being wrapped.
- Specified by:
getWrapped
in interfaceFacesWrapper<StateManager>
- Returns:
- the wrapped instance.
-
saveSerializedView
The default behavior of this method is to call
StateManager.saveSerializedView(javax.faces.context.FacesContext)
on the wrappedStateManager
object.- Overrides:
saveSerializedView
in classStateManager
- Parameters:
context
-FacesContext
for the current request- Returns:
- the serialized view, or null.
- Since:
- 1.2
- See Also:
-
saveView
The default behavior of this method is to call
StateManager.saveView(javax.faces.context.FacesContext)
on the wrappedStateManager
object.- Overrides:
saveView
in classStateManager
- Parameters:
context
-FacesContext
for the current request- Returns:
- the saved view.
- Since:
- 1.2
- See Also:
-
getTreeStructureToSave
The default behavior of this method is to call
StateManager.getTreeStructureToSave(javax.faces.context.FacesContext)
on the wrappedStateManager
object.- Overrides:
getTreeStructureToSave
in classStateManager
- Parameters:
context
-FacesContext
for the current request- Returns:
- the tree structure, or null.
- Since:
- 1.2
- See Also:
-
getComponentStateToSave
The default behavior of this method is to call
StateManager.getComponentStateToSave(javax.faces.context.FacesContext)
on the wrappedStateManager
object.- Overrides:
getComponentStateToSave
in classStateManager
- Parameters:
context
-FacesContext
for the current request- Returns:
- the component state, or null.
- Since:
- 1.2
- See Also:
-
writeState
The default behavior of this method is to call
StateManager.writeState(javax.faces.context.FacesContext, java.lang.Object)
on the wrappedStateManager
object.- Overrides:
writeState
in classStateManager
- Parameters:
context
-FacesContext
for the current requeststate
- the Serializable state to be written, as returned byStateManager.saveSerializedView(javax.faces.context.FacesContext)
- Throws:
IOException
- when an I/O error occurs.- Since:
- 1.2
- See Also:
-
writeState
The default behavior of this method is to call
StateManager.writeState(javax.faces.context.FacesContext, javax.faces.application.StateManager.SerializedView)
on the wrappedStateManager
object.- Overrides:
writeState
in classStateManager
- Parameters:
context
-FacesContext
for the current requeststate
- the serialized state to be written- Throws:
IOException
- when an I/O error occurs.- Since:
- 1.2
- See Also:
-
restoreView
The default behavior of this method is to call
StateManager.restoreView(javax.faces.context.FacesContext, String, String)
on the wrappedStateManager
object.- Specified by:
restoreView
in classStateManager
- Parameters:
context
-FacesContext
for the current requestviewId
- View identifier of the view to be restoredrenderKitId
- the renderKitId used to render this response. Must not benull
.- Returns:
- the view root, or
null
. - Since:
- 1.2
- See Also:
-
restoreTreeStructure
The default behavior of this method is to call
StateManager.restoreTreeStructure(javax.faces.context.FacesContext, String, String)
on the wrappedStateManager
object.- Overrides:
restoreTreeStructure
in classStateManager
- Parameters:
context
-FacesContext
for the current requestviewId
- View identifier of the view to be restoredrenderKitId
- the renderKitId used to render this response. Must not benull
.- Returns:
- the view root, or
null
. - Since:
- 1.2
- See Also:
-
restoreComponentState
The default behavior of this method is to call
StateManager.restoreComponentState(javax.faces.context.FacesContext, javax.faces.component.UIViewRoot, String)
on the wrappedStateManager
object.- Overrides:
restoreComponentState
in classStateManager
- Parameters:
context
-FacesContext
for the current requestviewRoot
-UIViewRoot
returned by a previous call torestoreTreeStructure()
renderKitId
- the renderKitId used to render this response. Must not benull
.- Since:
- 1.2
- See Also:
-
isSavingStateInClient
The default behavior of this method is to call
StateManager.isSavingStateInClient(javax.faces.context.FacesContext)
on the wrappedStateManager
object.- Overrides:
isSavingStateInClient
in classStateManager
- Parameters:
context
- the Faces context.- Returns:
true
if and only if the value of theServletContext
init parameter named by the value of the constantStateManager.STATE_SAVING_METHOD_PARAM_NAME
is equal (ignoring case) to the value of the constantStateManager.STATE_SAVING_METHOD_CLIENT
.false
otherwise.- Since:
- 1.2
- See Also:
-
getViewState
The default behavior of this method is to call
StateManager.getViewState(javax.faces.context.FacesContext)
on the wrappedStateManager
object.- Overrides:
getViewState
in classStateManager
- Parameters:
context
-FacesContext
for the current request- Returns:
- the view state.
- Since:
- 2.0
-