org.apache.myfaces.application.jsp
Class JspStateManagerImpl

java.lang.Object
  extended by javax.faces.application.StateManager
      extended by org.apache.myfaces.application.MyfacesStateManager
          extended by org.apache.myfaces.application.jsp.JspStateManagerImpl

public class JspStateManagerImpl
extends MyfacesStateManager

Default StateManager implementation for use when views are defined via tags in JSP pages.

Version:
$Revision: 694453 $ $Date: 2008-09-11 15:12:45 -0500 (Thu, 11 Sep 2008) $
Author:
Thomas Spiegl (latest modification by $Author: lu4242 $), Manfred Geiler

Nested Class Summary
protected static class JspStateManagerImpl.SerializedViewCollection
           
protected static class JspStateManagerImpl.SerializedViewKey
           
 
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
JspStateManagerImpl()
           
 
Method Summary
protected  StateManager.SerializedView deserializeView(Object state)
           
protected  Object getComponentStateToSave(FacesContext facesContext)
           
protected  RenderKitFactory getRenderKitFactory()
           
protected  StateManager.SerializedView getSerializedViewFromServletSession(FacesContext context, String viewId, String sequenceStr)
           
protected  Object getTreeStructureToSave(FacesContext facesContext)
          Return an object which contains info about the UIComponent type of each node in the view tree.
protected  boolean isCompressStateInSession(FacesContext context)
          Reads the value of the org.apache.myfaces.COMPRESS_STATE_IN_SESSION context parameter.
protected  boolean isSerializeStateInSession(FacesContext context)
          Reads the value of the org.apache.myfaces.SERIALIZE_STATE_IN_SESSION context parameter.
protected  void restoreComponentState(FacesContext facesContext, UIViewRoot uiViewRoot, String renderKitId)
          Given a tree of UIComponent objects created the default constructor for each node, retrieve saved state info (from either the client or the server) and walk the tree restoring the members of each node from the saved state information.
protected  UIViewRoot restoreTreeStructure(FacesContext facesContext, String viewId, String renderKitId)
          See getTreeStructureToSave.
 UIViewRoot restoreView(FacesContext facescontext, String viewId, String renderKitId)
           
 StateManager.SerializedView saveSerializedView(FacesContext facesContext)
           
protected  void saveSerializedViewInServletSession(FacesContext context, StateManager.SerializedView serializedView)
           
protected  Object serializeView(FacesContext context, StateManager.SerializedView serializedView)
           
 void writeState(FacesContext facesContext, StateManager.SerializedView serializedView)
           
 void writeStateAsUrlParams(FacesContext facesContext, StateManager.SerializedView serializedView)
          MyFaces extension
 
Methods inherited from class javax.faces.application.StateManager
isSavingStateInClient
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JspStateManagerImpl

public JspStateManagerImpl()
Method Detail

getComponentStateToSave

protected Object getComponentStateToSave(FacesContext facesContext)
Specified by:
getComponentStateToSave in class StateManager

getTreeStructureToSave

protected Object getTreeStructureToSave(FacesContext facesContext)
Return an object which contains info about the UIComponent type of each node in the view tree. This allows an identical UIComponent tree to be recreated later, though all the components will have just default values for their members.

Specified by:
getTreeStructureToSave in class StateManager

restoreComponentState

protected void restoreComponentState(FacesContext facesContext,
                                     UIViewRoot uiViewRoot,
                                     String renderKitId)
Given a tree of UIComponent objects created the default constructor for each node, retrieve saved state info (from either the client or the server) and walk the tree restoring the members of each node from the saved state information.

Specified by:
restoreComponentState in class StateManager

restoreTreeStructure

protected UIViewRoot restoreTreeStructure(FacesContext facesContext,
                                          String viewId,
                                          String renderKitId)
See getTreeStructureToSave.

Specified by:
restoreTreeStructure in class StateManager

restoreView

public UIViewRoot restoreView(FacesContext facescontext,
                              String viewId,
                              String renderKitId)
Specified by:
restoreView in class StateManager

saveSerializedView

public StateManager.SerializedView saveSerializedView(FacesContext facesContext)
                                               throws IllegalStateException
Specified by:
saveSerializedView in class StateManager
Throws:
IllegalStateException

writeState

public void writeState(FacesContext facesContext,
                       StateManager.SerializedView serializedView)
                throws IOException
Specified by:
writeState in class StateManager
Throws:
IOException

writeStateAsUrlParams

public void writeStateAsUrlParams(FacesContext facesContext,
                                  StateManager.SerializedView serializedView)
                           throws IOException
MyFaces extension

Specified by:
writeStateAsUrlParams in class MyfacesStateManager
Parameters:
facesContext -
serializedView -
Throws:
IOException

getRenderKitFactory

protected RenderKitFactory getRenderKitFactory()

saveSerializedViewInServletSession

protected void saveSerializedViewInServletSession(FacesContext context,
                                                  StateManager.SerializedView serializedView)

getSerializedViewFromServletSession

protected StateManager.SerializedView getSerializedViewFromServletSession(FacesContext context,
                                                                          String viewId,
                                                                          String sequenceStr)

serializeView

protected Object serializeView(FacesContext context,
                               StateManager.SerializedView serializedView)

isSerializeStateInSession

protected boolean isSerializeStateInSession(FacesContext context)
Reads the value of the org.apache.myfaces.SERIALIZE_STATE_IN_SESSION context parameter.

Parameters:
context - FacesContext for the request we are processing.
Returns:
boolean true, if the server state should be serialized in the session
See Also:
SERIALIZE_STATE_IN_SESSION_PARAM

isCompressStateInSession

protected boolean isCompressStateInSession(FacesContext context)
Reads the value of the org.apache.myfaces.COMPRESS_STATE_IN_SESSION context parameter.

Parameters:
context - FacesContext for the request we are processing.
Returns:
boolean true, if the server state steam should be compressed
See Also:
COMPRESS_SERVER_STATE_PARAM

deserializeView

protected StateManager.SerializedView deserializeView(Object state)


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.