javax.faces.application

## Class StateManagerWrapper

- java.lang.Object
- - javax.faces.application.StateManager
  - - javax.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 existing `StateManager` instance. The default implementation of all methods is to call through to the wrapped `StateManager`.

  Usage: extend this class and override `getWrapped()` to return the instance we are wrapping.

  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

    Constructors
    Constructor and Description
    `StateManagerWrapper()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected Object` | `getComponentStateToSave(FacesContext context)` The default behavior of this method is to call `StateManager.getComponentStateToSave(javax.faces.context.FacesContext)` on the wrapped `StateManager` object.
    `protected Object` | `getTreeStructureToSave(FacesContext context)` The default behavior of this method is to call `StateManager.getTreeStructureToSave(javax.faces.context.FacesContext)` on the wrapped `StateManager` object.
    `String` | `getViewState(FacesContext context)` The default behavior of this method is to call `StateManager.getViewState(javax.faces.context.FacesContext)` on the wrapped `StateManager` object.
    `abstract 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(javax.faces.context.FacesContext)` on the wrapped `StateManager` object.
    `protected void` | `restoreComponentState(FacesContext context, UIViewRoot viewRoot, String renderKitId)` The default behavior of this method is to call `StateManager.restoreComponentState(javax.faces.context.FacesContext, javax.faces.component.UIViewRoot, String)` on the wrapped `StateManager` object.
    `protected UIViewRoot` | `restoreTreeStructure(FacesContext context, String viewId, String renderKitId)` The default behavior of this method is to call `StateManager.restoreTreeStructure(javax.faces.context.FacesContext, String, String)` on the wrapped `StateManager` object.
    `UIViewRoot` | `restoreView(FacesContext context, String viewId, String renderKitId)` The default behavior of this method is to call `StateManager.restoreView(javax.faces.context.FacesContext, String, String)` on the wrapped `StateManager` object.
    `StateManager.SerializedView` | `saveSerializedView(FacesContext context)` The default behavior of this method is to call `StateManager.saveSerializedView(javax.faces.context.FacesContext)` on the wrapped `StateManager` object.
    `Object` | `saveView(FacesContext context)` The default behavior of this method is to call `StateManager.saveView(javax.faces.context.FacesContext)` on the wrapped `StateManager` object.
    `void` | `writeState(FacesContext context, Object state)` The default behavior of this method is to call `StateManager.writeState(javax.faces.context.FacesContext, java.lang.Object)` on the wrapped `StateManager` object.
    `void` | `writeState(FacesContext context, StateManager.SerializedView state)` The default behavior of this method is to call `StateManager.writeState(javax.faces.context.FacesContext, javax.faces.application.StateManager.SerializedView)` on the wrapped `StateManager` object.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### StateManagerWrapper

          public StateManagerWrapper()

  - ### Method Detail

    - #### getWrapped

          public abstract 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 interface `FacesWrapper<StateManager>`
      Returns:
        the instance that we are wrapping.

    - #### saveSerializedView

          public StateManager.SerializedView saveSerializedView(FacesContext context)

      The default behavior of this method is to call `StateManager.saveSerializedView(javax.faces.context.FacesContext)` on the wrapped `StateManager` object.

      Overrides:
        `saveSerializedView` in class `StateManager`
      Parameters:
        `context` - `FacesContext` for the current request
      Since:
        1.2
      See Also:
        `StateManager.saveSerializedView(javax.faces.context.FacesContext)`

    - #### saveView

          public Object saveView(FacesContext context)

      The default behavior of this method is to call `StateManager.saveView(javax.faces.context.FacesContext)` on the wrapped `StateManager` object.

      Overrides:
        `saveView` in class `StateManager`
      Parameters:
        `context` - `FacesContext` for the current request
      Since:
        1.2
      See Also:
        `StateManager.saveView(javax.faces.context.FacesContext)`

    - #### getTreeStructureToSave

          protected Object getTreeStructureToSave(FacesContext context)

      The default behavior of this method is to call `StateManager.getTreeStructureToSave(javax.faces.context.FacesContext)` on the wrapped `StateManager` object.

      Overrides:
        `getTreeStructureToSave` in class `StateManager`
      Parameters:
        `context` - `FacesContext` for the current request
      Since:
        1.2
      See Also:
        `StateManager.getTreeStructureToSave(javax.faces.context.FacesContext)`

    - #### getComponentStateToSave

          protected Object getComponentStateToSave(FacesContext context)

      The default behavior of this method is to call `StateManager.getComponentStateToSave(javax.faces.context.FacesContext)` on the wrapped `StateManager` object.

      Overrides:
        `getComponentStateToSave` in class `StateManager`
      Parameters:
        `context` - `FacesContext` for the current request
      Since:
        1.2
      See Also:
        `StateManager.getComponentStateToSave(javax.faces.context.FacesContext)`

    - #### writeState

          public void writeState(FacesContext context,
                        Object state)
                          throws IOException

      The default behavior of this method is to call `StateManager.writeState(javax.faces.context.FacesContext, java.lang.Object)` on the wrapped `StateManager` object.

      Overrides:
        `writeState` in class `StateManager`
      Parameters:
        `context` - `FacesContext` for the current request
        `state` - the Serializable state to be written, as returned by `StateManager.saveSerializedView(javax.faces.context.FacesContext)`
      Throws:
        `IOException`
      Since:
        1.2
      See Also:
        `StateManager.writeState(javax.faces.context.FacesContext, java.lang.Object)`

    - #### writeState

          public void writeState(FacesContext context,
                        StateManager.SerializedView state)
                          throws IOException

      The default behavior of this method is to call `StateManager.writeState(javax.faces.context.FacesContext, javax.faces.application.StateManager.SerializedView)` on the wrapped `StateManager` object.

      Overrides:
        `writeState` in class `StateManager`
      Parameters:
        `context` - `FacesContext` for the current request
        `state` - the serialized state to be written
      Throws:
        `IOException`
      Since:
        1.2
      See Also:
        `StateManager.writeState(javax.faces.context.FacesContext, javax.faces.application.StateManager.SerializedView)`

    - #### restoreView

          public UIViewRoot restoreView(FacesContext context,
                               String viewId,
                               String renderKitId)

      The default behavior of this method is to call `StateManager.restoreView(javax.faces.context.FacesContext, String, String)` on the wrapped `StateManager` object.

      Specified by:
        `restoreView` in class `StateManager`
      Parameters:
        `context` - `FacesContext` for the current request
        `viewId` - View identifier of the view to be restored
        `renderKitId` - the renderKitId used to render this response. Must not be `null`.
      Since:
        1.2
      See Also:
        `StateManager.restoreView(javax.faces.context.FacesContext, String, String)`

    - #### restoreTreeStructure

          protected UIViewRoot restoreTreeStructure(FacesContext context,
                                        String viewId,
                                        String renderKitId)

      The default behavior of this method is to call `StateManager.restoreTreeStructure(javax.faces.context.FacesContext, String, String)` on the wrapped `StateManager` object.

      Overrides:
        `restoreTreeStructure` in class `StateManager`
      Parameters:
        `context` - `FacesContext` for the current request
        `viewId` - View identifier of the view to be restored
        `renderKitId` - the renderKitId used to render this response. Must not be `null`.
      Since:
        1.2
      See Also:
        `StateManager.restoreTreeStructure(javax.faces.context.FacesContext, String, String)`

    - #### restoreComponentState

          protected void restoreComponentState(FacesContext context,
                                   UIViewRoot viewRoot,
                                   String renderKitId)

      The default behavior of this method is to call `StateManager.restoreComponentState(javax.faces.context.FacesContext, javax.faces.component.UIViewRoot, String)` on the wrapped `StateManager` object.

      Overrides:
        `restoreComponentState` in class `StateManager`
      Parameters:
        `context` - `FacesContext` for the current request
        `viewRoot` - `UIViewRoot` returned by a previous call to `restoreTreeStructure()`
        `renderKitId` - the renderKitId used to render this response. Must not be `null`.
      Since:
        1.2
      See Also:
        `StateManager.restoreComponentState(javax.faces.context.FacesContext, javax.faces.component.UIViewRoot, String)`

    - #### isSavingStateInClient

          public boolean isSavingStateInClient(FacesContext context)

      The default behavior of this method is to call `StateManager.isSavingStateInClient(javax.faces.context.FacesContext)` on the wrapped `StateManager` object.

      Overrides:
        `isSavingStateInClient` in class `StateManager`
      Returns:
        `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 to the value of the constant `StateManager.STATE_SAVING_METHOD_CLIENT`. `false` otherwise.
      Since:
        1.2
      See Also:
        `StateManager.isSavingStateInClient(javax.faces.context.FacesContext)`

    - #### getViewState

          public String getViewState(FacesContext context)

      The default behavior of this method is to call `StateManager.getViewState(javax.faces.context.FacesContext)` on the wrapped `StateManager` object.

      Overrides:
        `getViewState` in class `StateManager`
      Parameters:
        `context` - `FacesContext` for the current request
      Since:
        2.0

Copyright © 1996-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.