JSF-Spring

de.mindmatters.faces.application
Class AbstractViewBuildingStateManager

java.lang.Object
  extended by javax.faces.application.StateManager
      extended by de.mindmatters.faces.application.AbstractViewBuildingStateManager
Direct Known Subclasses:
NoStateManager, OptimizedStateManager

public abstract class AbstractViewBuildingStateManager
extends StateManager

AbstractViewBuildingStateManager directs the process of saving and restoring the view between requests.

This state manager only works with a view handler of type ViewBuilder! Because an implemention of a ViewBuilder is able to restore the structure of a component tree of a view without a given serialized state this state manager writes no component structure state. This class restores the component tree by invoking the method ViewBuilder.buildView(FacesContext, String) of the configured view handler.

Subclasses have to implement saving (see StateManager.getComponentStateToSave(FacesContext)) and restoring (see StateManager.restoreComponentState(FacesContext, UIViewRoot, String)) of the component state.

Author:
Andreas Kuhrwahl
See Also:
ViewBuilder.buildView(FacesContext, String)

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
STATE_SAVING_METHOD_CLIENT, STATE_SAVING_METHOD_PARAM_NAME, STATE_SAVING_METHOD_SERVER
 
Constructor Summary
AbstractViewBuildingStateManager(StateManager delegate)
          Creates an StateManager with the given state manager delegate of the underlying JSF implementation.
 
Method Summary
protected  java.lang.Object getTreeStructureToSave(FacesContext context)
          
protected  UIViewRoot restoreTreeStructure(FacesContext context, java.lang.String viewId, java.lang.String renderKitId)
          
 UIViewRoot restoreView(FacesContext context, java.lang.String viewId, java.lang.String renderKitId)
          
 StateManager.SerializedView saveSerializedView(FacesContext context)
          
 void writeState(FacesContext context, StateManager.SerializedView state)
          
 
Methods inherited from class javax.faces.application.StateManager
getComponentStateToSave, isSavingStateInClient, restoreComponentState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractViewBuildingStateManager

public AbstractViewBuildingStateManager(StateManager delegate)
Creates an StateManager with the given state manager delegate of the underlying JSF implementation.

Parameters:
delegate - the original state manager of the underlying JSF implementation
Method Detail

saveSerializedView

public final StateManager.SerializedView saveSerializedView(FacesContext context)

Specified by:
saveSerializedView in class StateManager

getTreeStructureToSave

protected final java.lang.Object getTreeStructureToSave(FacesContext context)

Specified by:
getTreeStructureToSave in class StateManager

writeState

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

Specified by:
writeState in class StateManager
Throws:
java.io.IOException

restoreView

public final UIViewRoot restoreView(FacesContext context,
                                    java.lang.String viewId,
                                    java.lang.String renderKitId)

Specified by:
restoreView in class StateManager

restoreTreeStructure

protected final UIViewRoot restoreTreeStructure(FacesContext context,
                                                java.lang.String viewId,
                                                java.lang.String renderKitId)

Specified by:
restoreTreeStructure in class StateManager

JSF-Spring

Copyright © 2006 mindmatters GmbH & Co. KG