statemanager.html

来自「j2ee帮助文档软件设计/软件工程 文件格式」· HTML 代码 · 共 780 行 · 第 1/4 页

HTML
780
字号
<!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR></TABLE><A NAME="saveSerializedView(javax.faces.context.FacesContext)"><!-- --></A><H3>saveSerializedView</H3><PRE>public <A HREF="../../../javax/faces/application/StateManager.SerializedView.html" title="class in javax.faces.application">StateManager.SerializedView</A> <B>saveSerializedView</B>(<A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context">FacesContext</A>&nbsp;context)</PRE><DL><DD><B>Deprecated.</B>&nbsp;<I>this has been replaced by <A HREF="../../../javax/faces/application/StateManager.html#saveView(javax.faces.context.FacesContext)"><CODE>saveView(javax.faces.context.FacesContext)</CODE></A>.  The             default implementation returns <code>null</code>.</I><P><DD><p>Return the tree structure and component state information for the view contained in the specified <A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context"><CODE>FacesContext</CODE></A> instance as an object of type <code>StateManager.SerializedView</code>.  If there is no state information to be saved, return <code>null</code> instead.</p> <p/> <p>Components may opt out of being included in the serialized view by setting their <code>transient</code> property to <code>true</code>. This must cause the component itself, as well as all of that component's children and facets, to be omitted from the saved  tree structure and component state information.</p> <p/> <p>This method must also enforce the rule that, for components with non-null <code>id</code>s, all components that are descendants of the same nearest <A HREF="../../../javax/faces/component/NamingContainer.html" title="interface in javax.faces.component"><CODE>NamingContainer</CODE></A> must have unique identifiers.</p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>context</CODE> - <A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context"><CODE>FacesContext</CODE></A> for the current request<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - if more than one component or                               facet within the same <A HREF="../../../javax/faces/component/NamingContainer.html" title="interface in javax.faces.component"><CODE>NamingContainer</CODE></A> in this view has                               the same non-<code>null</code> component id</DL></DD></DL><HR><A NAME="saveView(javax.faces.context.FacesContext)"><!-- --></A><H3>saveView</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>saveView</B>(<A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context">FacesContext</A>&nbsp;context)</PRE><DL><DD><p>Return an opaque <code>Object</code> containing sufficient information for this same instance to restore the state of the current <A HREF="../../../javax/faces/component/UIViewRoot.html" title="class in javax.faces.component"><CODE>UIViewRoot</CODE></A> on a subsequent request.  The returned object must implement <code>java.io.Serializable</code>. If there is no state information to be saved, return <code>null</code> instead.</p> <p/> <p>Components may opt out of being included in the serialized view by setting their <code>transient</code> property to <code>true</code>. This must cause the component itself, as well as all of that component's children and facets, to be omitted from the saved  tree structure and component state information.</p> <p/> <p>This method must also enforce the rule that, for components with non-null <code>id</code>s, all components that are descendants of the same nearest <A HREF="../../../javax/faces/component/NamingContainer.html" title="interface in javax.faces.component"><CODE>NamingContainer</CODE></A> must have unique identifiers.</p> <p/> <p>For backwards compatability with existing <code>StateManager</code> implementations, the default implementation of this method calls <A HREF="../../../javax/faces/application/StateManager.html#saveSerializedView(javax.faces.context.FacesContext)"><CODE>saveSerializedView(javax.faces.context.FacesContext)</CODE></A> and creates and returns a two element <code>Object</code> array with element zero containing the <code>structure</code> property and element one containing the <code>state</code> property of the <code>SerializedView</code>.</p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>context</CODE> - <A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context"><CODE>FacesContext</CODE></A> for the current request<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - if more than one component or                               facet within the same <A HREF="../../../javax/faces/component/NamingContainer.html" title="interface in javax.faces.component"><CODE>NamingContainer</CODE></A> in this view has                               the same non-<code>null</code> component id<DT><B>Since:</B></DT>  <DD>1.2</DD></DL></DD></DL><HR><A NAME="getTreeStructureToSave(javax.faces.context.FacesContext)"><!-- --></A><H3>getTreeStructureToSave</H3><PRE>protected <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>getTreeStructureToSave</B>(<A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context">FacesContext</A>&nbsp;context)</PRE><DL><DD><B>Deprecated.</B>&nbsp;<I>the distinction between tree structure and component             state is now an implementation detail.  The default             implementation returns <code>null</code>.</I><P><DD><p>Convenience method, which must be called by <code>saveSerializedView()</code>, to construct and return a <code>Serializable</code> object that represents the structure of the entire component tree (including children and facets) of this view.</p> <p/> <p>Components may opt-out of being included in the tree structure by setting their <code>transient</code> property to <code>true</code>. This must cause the component itself, as well as all of that component's children and facets, to be omitted from the saved  tree structure information.</p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>context</CODE> - <A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context"><CODE>FacesContext</CODE></A> for the current request</DL></DD></DL><HR><A NAME="getComponentStateToSave(javax.faces.context.FacesContext)"><!-- --></A><H3>getComponentStateToSave</H3><PRE>protected <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>getComponentStateToSave</B>(<A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context">FacesContext</A>&nbsp;context)</PRE><DL><DD><B>Deprecated.</B>&nbsp;<I>the distinction between tree structure and component             state is now an implementation detail.  The default             implementation returns <code>null</code>.</I><P><DD><p>Convenience method, which must be called by <code>saveSerializedView()</code>, to construct and return a <code>Serializable</code> object that represents the state of all component properties, attributes, and attached objects, for the entire component tree (including children and facets) of this view.</p> <p/> <p>Components may opt-out of being included in the component state by setting their <code>transient</code> property to <code>true</code>. This must cause the component itself, as well as all of that component's children and facets, to be omitted from the saved component state information.</p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>context</CODE> - <A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context"><CODE>FacesContext</CODE></A> for the current request</DL></DD></DL><HR><A NAME="writeState(javax.faces.context.FacesContext, java.lang.Object)"><!-- --></A><H3>writeState</H3><PRE>public void <B>writeState</B>(<A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context">FacesContext</A>&nbsp;context,                       <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;state)                throws <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD><p>Save the state represented in the specified state <code>Object</code> instance, in an implementation dependent manner.</p> <p/> <p>This method will typically simply delegate the actual writing to the <code>writeState()</code> method of the <A HREF="../../../javax/faces/render/ResponseStateManager.html" title="class in javax.faces.render"><CODE>ResponseStateManager</CODE></A> instance provided by the <A HREF="../../../javax/faces/render/RenderKit.html" title="class in javax.faces.render"><CODE>RenderKit</CODE></A> being used to render this view.  This method assumes that the caller has positioned the <A HREF="../../../javax/faces/context/ResponseWriter.html" title="class in javax.faces.context"><CODE>ResponseWriter</CODE></A> at the correct position for the saved state to be written.</p> <p/> <p>For backwards compatability with existing <code>StateManager</code> implementations, the default implementation of this method checks if the argument is an instance of <code>Object []</code> of length greater than or equal to two.  If so, it creates a <code>SerializedView</code> instance with the tree structure coming from element zero and the component state coming from element one and calls through to <A HREF="../../../javax/faces/application/StateManager.html#writeState(javax.faces.context.FacesContext, javax.faces.application.StateManager.SerializedView)"><CODE>writeState(javax.faces.context.FacesContext,javax.faces.application.StateManager.SerializedView)</CODE></A>. If not, does nothing.</p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>context</CODE> - <A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context"><CODE>FacesContext</CODE></A> for the current request<DD><CODE>state</CODE> - the Serializable state to be written,                as returned by <A HREF="../../../javax/faces/application/StateManager.html#saveSerializedView(javax.faces.context.FacesContext)"><CODE>saveSerializedView(javax.faces.context.FacesContext)</CODE></A><DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE><DT><B>Since:</B></DT>  <DD>1.2</DD></DL></DD></DL><HR><A NAME="writeState(javax.faces.context.FacesContext, javax.faces.application.StateManager.SerializedView)"><!-- --></A><H3>writeState</H3><PRE>public void <B>writeState</B>(<A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context">FacesContext</A>&nbsp;context,                       <A HREF="../../../javax/faces/application/StateManager.SerializedView.html" title="class in javax.faces.application">StateManager.SerializedView</A>&nbsp;state)                throws <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD><B>Deprecated.</B>&nbsp;<I>This method has been replaced by <A HREF="../../../javax/faces/application/StateManager.html#writeState(javax.faces.context.FacesContext, java.lang.Object)"><CODE>writeState(javax.faces.context.FacesContext,java.lang.Object)</CODE></A>.             The default implementation of this method does nothing.</I><P><DD><p>Save the state represented in the specified <code>SerializedView</code> isntance, in an implementation dependent manner.</p>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?