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 StateManager
StateManager.StateSavingMethodModifier and TypeClassDescriptionstatic enumAllowed values for the initialization parameter named by the "jakarta.faces.STATE_SAVING_METHOD". -
Field Summary
Fields inherited from class 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_SERVERModifier and TypeFieldDescriptionstatic final StringDeprecated, for removal: This API element is subject to removal in a future version.Full state saving will be removed in favor of partial state saving in order to keep the spec simple.static final StringMarker within theFacesContextattributes map to indicate we are marking initial state, so themarkInitialState()method of iterating components such asUIDatacould recognize this fact and save the initial state of descendents.static final StringMarker within theFacesContextattributes map to indicate we are saving state.static final StringDeprecated, for removal: This API element is subject to removal in a future version.Full state saving will be removed in favor of partial state saving in order to keep the spec simple.static final StringIf this param is set, and calling toLowerCase().equals("true") on a String representation of its value returns true, and the jakarta.faces.STATE_SAVING_METHOD is set to "server" (as indicated below), the server state must be guaranteed to be Serializable such that the aggregate state implements java.io.Serializable.static final StringDeprecated, for removal: This API element is subject to removal in a future version.UseStateManager.StateSavingMethod.CLIENTinstead.static final StringTheServletContextinit parameter consulted by theStateManagerto tell where the state should be saved.static final StringDeprecated, for removal: This API element is subject to removal in a future version.UseStateManager.StateSavingMethod.SERVERinstead. -
Constructor Summary
ConstructorsConstructorDescriptionStateManagerWrapper(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 TypeMethodDescriptiongetViewState(FacesContext context) The default behavior of this method is to callStateManager.getViewState(jakarta.faces.context.FacesContext)on the wrappedStateManagerobject.A class that implements this interface uses this method to return an instance of the class being wrapped.booleanisSavingStateInClient(FacesContext context) The default behavior of this method is to callStateManager.isSavingStateInClient(jakarta.faces.context.FacesContext)on the wrappedStateManagerobject.voidwriteState(FacesContext context, Object state) The default behavior of this method is to callStateManager.writeState(jakarta.faces.context.FacesContext, java.lang.Object)on the wrappedStateManagerobject.
-
Constructor Details
-
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:FacesWrapperA class that implements this interface uses this method to return an instance of the class being wrapped.
- Specified by:
getWrappedin interfaceFacesWrapper<StateManager>- Returns:
- the wrapped instance.
-
writeState
The default behavior of this method is to call
StateManager.writeState(jakarta.faces.context.FacesContext, java.lang.Object)on the wrappedStateManagerobject.- Overrides:
writeStatein classStateManager- Parameters:
context-FacesContextfor the current requeststate- the state to be written- Throws:
IOException- when an I/O error occurs.- Since:
- 1.2
- See Also:
-
isSavingStateInClient
The default behavior of this method is to call
StateManager.isSavingStateInClient(jakarta.faces.context.FacesContext)on the wrappedStateManagerobject.- Overrides:
isSavingStateInClientin classStateManager- Parameters:
context- the Faces context.- Returns:
trueif and only if the value of theServletContextinit parameter named by the value of the constantStateManager.STATE_SAVING_METHOD_PARAM_NAMEis equal (ignoring case) to the value of the constantStateManager.StateSavingMethod.CLIENT.falseotherwise.- Since:
- 1.2
- See Also:
-
getViewState
The default behavior of this method is to call
StateManager.getViewState(jakarta.faces.context.FacesContext)on the wrappedStateManagerobject.- Overrides:
getViewStatein classStateManager- Parameters:
context-FacesContextfor the current request- Returns:
- the view state.
- Since:
- 2.0
-