Class StateManagerWrapper
- java.lang.Object
-
- jakarta.faces.application.StateManager
-
- jakarta.faces.application.StateManagerWrapper
-
- All Implemented Interfaces:
FacesWrapper<StateManager>
public abstract class StateManagerWrapper extends StateManager implements FacesWrapper<StateManager>
Provides a simple implementation of
StateManager
that can be subclassed by developers wishing to provide specialized behavior to an existingStateManager
instance. The default implementation of all methods is to call through to the wrappedStateManager
.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
-
-
Field Summary
-
Fields inherited from class jakarta.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
Constructors Constructor Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getViewState(FacesContext context)
The default behavior of this method is to callStateManager.getViewState(jakarta.faces.context.FacesContext)
on the wrappedStateManager
object.StateManager
getWrapped()
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(jakarta.faces.context.FacesContext)
on the wrappedStateManager
object.void
writeState(FacesContext context, Object state)
The default behavior of this method is to callStateManager.writeState(jakarta.faces.context.FacesContext, java.lang.Object)
on the wrappedStateManager
object.
-
-
-
Constructor Detail
-
StateManagerWrapper
public StateManagerWrapper(StateManager wrapped)
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 Detail
-
getWrapped
public StateManager 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.
-
writeState
public void writeState(FacesContext context, Object state) throws IOException
The default behavior of this method is to call
StateManager.writeState(jakarta.faces.context.FacesContext, java.lang.Object)
on the wrappedStateManager
object.- Overrides:
writeState
in classStateManager
- Parameters:
context
-FacesContext
for the current requeststate
- the state to be written- Throws:
IOException
- when an I/O error occurs.- Since:
- 1.2
- See Also:
StateManager.writeState(jakarta.faces.context.FacesContext, java.lang.Object)
-
isSavingStateInClient
public boolean isSavingStateInClient(FacesContext context)
The default behavior of this method is to call
StateManager.isSavingStateInClient(jakarta.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:
StateManager.isSavingStateInClient(jakarta.faces.context.FacesContext)
-
getViewState
public String getViewState(FacesContext context)
The default behavior of this method is to call
StateManager.getViewState(jakarta.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
-
-