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 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.
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 and 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. |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getViewState(FacesContext context)
The default behavior of this method is to call |
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 call
StateManager.isSavingStateInClient(jakarta.faces.context.FacesContext) on the wrapped StateManager
object. |
void |
writeState(FacesContext context,
java.lang.Object state)
The default behavior of this method is to call
StateManager.writeState(jakarta.faces.context.FacesContext, java.lang.Object) on the wrapped
StateManager object. |
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.
wrapped
- The implementation being wrapped.public StateManager getWrapped()
FacesWrapper
A class that implements this interface uses this method to return an instance of the class being wrapped.
getWrapped
in interface FacesWrapper<StateManager>
public void writeState(FacesContext context, java.lang.Object state) throws java.io.IOException
The default behavior of this method is to call
StateManager.writeState(jakarta.faces.context.FacesContext, java.lang.Object)
on the wrapped
StateManager
object.
writeState
in class StateManager
context
- FacesContext
for the current requeststate
- the state to be writtenjava.io.IOException
- when an I/O error occurs.StateManager.writeState(jakarta.faces.context.FacesContext, java.lang.Object)
public boolean isSavingStateInClient(FacesContext context)
The default behavior of this method is to call
StateManager.isSavingStateInClient(jakarta.faces.context.FacesContext)
on the wrapped StateManager
object.
isSavingStateInClient
in class StateManager
context
- the Faces context.true
if and only if the value of the ServletContext
init parameter named by the
value of the constant StateManager.STATE_SAVING_METHOD_PARAM_NAME
is equal (ignoring
case) to the value of the constant StateManager.STATE_SAVING_METHOD_CLIENT
. false
otherwise.StateManager.isSavingStateInClient(jakarta.faces.context.FacesContext)
public java.lang.String getViewState(FacesContext context)
The default behavior of this method is to call StateManager.getViewState(jakarta.faces.context.FacesContext)
on the wrapped StateManager
object.
getViewState
in class StateManager
context
- FacesContext
for the current request