📄 stateholder.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc (build 1.5.0_14) on Mon Jan 28 05:46:46 PST 2008 --><TITLE>StateHolder (Java EE 5)</TITLE><META NAME="keywords" CONTENT="javax.faces.component.StateHolder interface"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){ parent.document.title="StateHolder (Java EE 5)";}</SCRIPT><NOSCRIPT></NOSCRIPT></HEAD><BODY BGCOLOR="white" onload="windowTitle();"><!-- ========= START OF TOP NAVBAR ======= --><A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../javax/faces/component/NamingContainer.html" title="interface in javax.faces.component"><B>PREV CLASS</B></A> <A HREF="../../../javax/faces/component/UIColumn.html" title="class in javax.faces.component"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?javax/faces/component/StateHolder.html" target="_top"><B>FRAMES</B></A> <A HREF="StateHolder.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">javax.faces.component</FONT><BR>Interface StateHolder</H2><DL><DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../javax/faces/convert/DateTimeConverter.html" title="class in javax.faces.convert">DateTimeConverter</A>, <A HREF="../../../javax/faces/validator/DoubleRangeValidator.html" title="class in javax.faces.validator">DoubleRangeValidator</A>, <A HREF="../../../javax/faces/convert/EnumConverter.html" title="class in javax.faces.convert">EnumConverter</A>, <A HREF="../../../javax/faces/component/html/HtmlColumn.html" title="class in javax.faces.component.html">HtmlColumn</A>, <A HREF="../../../javax/faces/component/html/HtmlCommandButton.html" title="class in javax.faces.component.html">HtmlCommandButton</A>, <A HREF="../../../javax/faces/component/html/HtmlCommandLink.html" title="class in javax.faces.component.html">HtmlCommandLink</A>, <A HREF="../../../javax/faces/component/html/HtmlDataTable.html" title="class in javax.faces.component.html">HtmlDataTable</A>, <A HREF="../../../javax/faces/component/html/HtmlForm.html" title="class in javax.faces.component.html">HtmlForm</A>, <A HREF="../../../javax/faces/component/html/HtmlGraphicImage.html" title="class in javax.faces.component.html">HtmlGraphicImage</A>, <A HREF="../../../javax/faces/component/html/HtmlInputHidden.html" title="class in javax.faces.component.html">HtmlInputHidden</A>, <A HREF="../../../javax/faces/component/html/HtmlInputSecret.html" title="class in javax.faces.component.html">HtmlInputSecret</A>, <A HREF="../../../javax/faces/component/html/HtmlInputText.html" title="class in javax.faces.component.html">HtmlInputText</A>, <A HREF="../../../javax/faces/component/html/HtmlInputTextarea.html" title="class in javax.faces.component.html">HtmlInputTextarea</A>, <A HREF="../../../javax/faces/component/html/HtmlMessage.html" title="class in javax.faces.component.html">HtmlMessage</A>, <A HREF="../../../javax/faces/component/html/HtmlMessages.html" title="class in javax.faces.component.html">HtmlMessages</A>, <A HREF="../../../javax/faces/component/html/HtmlOutputFormat.html" title="class in javax.faces.component.html">HtmlOutputFormat</A>, <A HREF="../../../javax/faces/component/html/HtmlOutputLabel.html" title="class in javax.faces.component.html">HtmlOutputLabel</A>, <A HREF="../../../javax/faces/component/html/HtmlOutputLink.html" title="class in javax.faces.component.html">HtmlOutputLink</A>, <A HREF="../../../javax/faces/component/html/HtmlOutputText.html" title="class in javax.faces.component.html">HtmlOutputText</A>, <A HREF="../../../javax/faces/component/html/HtmlPanelGrid.html" title="class in javax.faces.component.html">HtmlPanelGrid</A>, <A HREF="../../../javax/faces/component/html/HtmlPanelGroup.html" title="class in javax.faces.component.html">HtmlPanelGroup</A>, <A HREF="../../../javax/faces/component/html/HtmlSelectBooleanCheckbox.html" title="class in javax.faces.component.html">HtmlSelectBooleanCheckbox</A>, <A HREF="../../../javax/faces/component/html/HtmlSelectManyCheckbox.html" title="class in javax.faces.component.html">HtmlSelectManyCheckbox</A>, <A HREF="../../../javax/faces/component/html/HtmlSelectManyListbox.html" title="class in javax.faces.component.html">HtmlSelectManyListbox</A>, <A HREF="../../../javax/faces/component/html/HtmlSelectManyMenu.html" title="class in javax.faces.component.html">HtmlSelectManyMenu</A>, <A HREF="../../../javax/faces/component/html/HtmlSelectOneListbox.html" title="class in javax.faces.component.html">HtmlSelectOneListbox</A>, <A HREF="../../../javax/faces/component/html/HtmlSelectOneMenu.html" title="class in javax.faces.component.html">HtmlSelectOneMenu</A>, <A HREF="../../../javax/faces/component/html/HtmlSelectOneRadio.html" title="class in javax.faces.component.html">HtmlSelectOneRadio</A>, <A HREF="../../../javax/faces/validator/LengthValidator.html" title="class in javax.faces.validator">LengthValidator</A>, <A HREF="../../../javax/faces/validator/LongRangeValidator.html" title="class in javax.faces.validator">LongRangeValidator</A>, <A HREF="../../../javax/faces/event/MethodExpressionActionListener.html" title="class in javax.faces.event">MethodExpressionActionListener</A>, <A HREF="../../../javax/faces/validator/MethodExpressionValidator.html" title="class in javax.faces.validator">MethodExpressionValidator</A>, <A HREF="../../../javax/faces/event/MethodExpressionValueChangeListener.html" title="class in javax.faces.event">MethodExpressionValueChangeListener</A>, <A HREF="../../../javax/faces/convert/NumberConverter.html" title="class in javax.faces.convert">NumberConverter</A>, <A HREF="../../../javax/faces/component/UIColumn.html" title="class in javax.faces.component">UIColumn</A>, <A HREF="../../../javax/faces/component/UICommand.html" title="class in javax.faces.component">UICommand</A>, <A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component">UIComponent</A>, <A HREF="../../../javax/faces/component/UIComponentBase.html" title="class in javax.faces.component">UIComponentBase</A>, <A HREF="../../../javax/faces/component/UIData.html" title="class in javax.faces.component">UIData</A>, <A HREF="../../../javax/faces/component/UIForm.html" title="class in javax.faces.component">UIForm</A>, <A HREF="../../../javax/faces/component/UIGraphic.html" title="class in javax.faces.component">UIGraphic</A>, <A HREF="../../../javax/faces/component/UIInput.html" title="class in javax.faces.component">UIInput</A>, <A HREF="../../../javax/faces/component/UIMessage.html" title="class in javax.faces.component">UIMessage</A>, <A HREF="../../../javax/faces/component/UIMessages.html" title="class in javax.faces.component">UIMessages</A>, <A HREF="../../../javax/faces/component/UINamingContainer.html" title="class in javax.faces.component">UINamingContainer</A>, <A HREF="../../../javax/faces/component/UIOutput.html" title="class in javax.faces.component">UIOutput</A>, <A HREF="../../../javax/faces/component/UIPanel.html" title="class in javax.faces.component">UIPanel</A>, <A HREF="../../../javax/faces/component/UIParameter.html" title="class in javax.faces.component">UIParameter</A>, <A HREF="../../../javax/faces/component/UISelectBoolean.html" title="class in javax.faces.component">UISelectBoolean</A>, <A HREF="../../../javax/faces/component/UISelectItem.html" title="class in javax.faces.component">UISelectItem</A>, <A HREF="../../../javax/faces/component/UISelectItems.html" title="class in javax.faces.component">UISelectItems</A>, <A HREF="../../../javax/faces/component/UISelectMany.html" title="class in javax.faces.component">UISelectMany</A>, <A HREF="../../../javax/faces/component/UISelectOne.html" title="class in javax.faces.component">UISelectOne</A>, <A HREF="../../../javax/faces/component/UIViewRoot.html" title="class in javax.faces.component">UIViewRoot</A></DD></DL><HR><DL><DT><PRE>public interface <B>StateHolder</B></DL></PRE><P><p>This interface is implemented by classes that need to save their state between requests.</p> <p>An implementor <strong>must</strong> implement both <A HREF="../../../javax/faces/component/StateHolder.html#saveState(javax.faces.context.FacesContext)"><CODE>saveState(javax.faces.context.FacesContext)</CODE></A> and <A HREF="../../../javax/faces/component/StateHolder.html#restoreState(javax.faces.context.FacesContext, java.lang.Object)"><CODE>restoreState(javax.faces.context.FacesContext, java.lang.Object)</CODE></A> methods in this class, since these two methods have a tightly coupled contract between themselves. In other words, if there is an ineritance hierarchy, it is not permissable to have the <A HREF="../../../javax/faces/component/StateHolder.html#saveState(javax.faces.context.FacesContext)"><CODE>saveState(javax.faces.context.FacesContext)</CODE></A> and <A HREF="../../../javax/faces/component/StateHolder.html#restoreState(javax.faces.context.FacesContext, java.lang.Object)"><CODE>restoreState(javax.faces.context.FacesContext, java.lang.Object)</CODE></A> methods reside at different levels of the hierarchy.</p> <p>An implementor must have a public no-args constructor.</p><P><P><HR><P><!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>Method Summary</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/faces/component/StateHolder.html#isTransient()">isTransient</A></B>()</CODE><BR> If true, the Object implementing this interface must not participate in state saving or restoring.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/faces/component/StateHolder.html#restoreState(javax.faces.context.FacesContext, java.lang.Object)">restoreState</A></B>(<A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context">FacesContext</A> 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> state)</CODE><BR> Perform any processing required to restore the state from the entries in the state Object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/faces/component/StateHolder.html#saveState(javax.faces.context.FacesContext)">saveState</A></B>(<A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context">FacesContext</A> context)</CODE><BR> Gets the state of the instance as a <code>Serializable</code> Object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/faces/component/StateHolder.html#setTransient(boolean)">setTransient</A></B>(boolean newTransientValue)</CODE><BR> Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.</TD></TR></TABLE> <P>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -