enumconverter.html

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

HTML
588
字号
<PRE>public <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getAsString</B>(<A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context">FacesContext</A>&nbsp;context,                          <A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component">UIComponent</A>&nbsp;component,                          <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;value)</PRE><DL><DD><p>Convert the enum constant given by the <code>value</code> argument into a String.  If no target class argument has been  provided to the constructor of this instance, throw a  <code>ConverterException</code> containing the  <A HREF="../../../javax/faces/convert/EnumConverter.html#ENUM_NO_CLASS_ID"><CODE>ENUM_NO_CLASS_ID</CODE></A> message with proper parameters. If the  <code>value,/code> argument is <code>null</code>, return <code>null</code>. If the value is an instance of the provided target class, return its  string value (<code>value.toString()</code>).  Otherwise, throw a  <A HREF="../../../javax/faces/convert/ConverterException.html" title="class in javax.faces.convert"><CODE>ConverterException</CODE></A> containing the <A HREF="../../../javax/faces/convert/EnumConverter.html#ENUM_ID"><CODE>ENUM_ID</CODE></A> message with  proper parameters.</p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/faces/convert/Converter.html#getAsString(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.Object)">getAsString</A></CODE> in interface <CODE><A HREF="../../../javax/faces/convert/Converter.html" title="interface in javax.faces.convert">Converter</A></CODE></DL></DD><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 request being processed<DD><CODE>component</CODE> - <A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component"><CODE>UIComponent</CODE></A> with which this model object  value is associated<DD><CODE>value</CODE> - Model object value to be converted   (may be <code>null</code>)<DT><B>Returns:</B><DD>a zero-length String if value is <code>null</code>,   otherwise the result of the conversion<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/faces/convert/ConverterException.html" title="class in javax.faces.convert">ConverterException</A></CODE> - if conversion cannot be successfully  performed<DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/NullPointerException.html" title="class or interface in java.lang">NullPointerException</A></CODE> - if <code>context</code> or  <code>component</code> is <code>null</code></DL></DD></DL><HR><A NAME="restoreState(javax.faces.context.FacesContext, java.lang.Object)"><!-- --></A><H3>restoreState</H3><PRE>public void <B>restoreState</B>(<A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context">FacesContext</A>&nbsp;facesContext,                         <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;object)</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../javax/faces/component/StateHolder.html#restoreState(javax.faces.context.FacesContext, java.lang.Object)">StateHolder</A></CODE></B></DD><DD><p> Perform any processing required to restore the state from the entries in the state Object.</p> <p>If the class that implements this interface has references to instances that also implement StateHolder (such as a <code>UIComponent</code> with event handlers, validators, etc.) this method must call the <A HREF="../../../javax/faces/component/StateHolder.html#restoreState(javax.faces.context.FacesContext, java.lang.Object)"><CODE>StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object)</CODE></A> method on all those instances as well. </p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/faces/component/StateHolder.html#restoreState(javax.faces.context.FacesContext, java.lang.Object)">restoreState</A></CODE> in interface <CODE><A HREF="../../../javax/faces/component/StateHolder.html" title="interface in javax.faces.component">StateHolder</A></CODE></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="saveState(javax.faces.context.FacesContext)"><!-- --></A><H3>saveState</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>saveState</B>(<A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context">FacesContext</A>&nbsp;facesContext)</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../javax/faces/component/StateHolder.html#saveState(javax.faces.context.FacesContext)">StateHolder</A></CODE></B></DD><DD><p> Gets the state of the instance as a <code>Serializable</code> Object.<p> <p>If the class that implements this interface has references to instances that implement StateHolder (such as a <code>UIComponent</code> with event handlers, validators, etc.) this method must call the <A HREF="../../../javax/faces/component/StateHolder.html#saveState(javax.faces.context.FacesContext)"><CODE>StateHolder.saveState(javax.faces.context.FacesContext)</CODE></A> method on all those instances as well.  <strong>This method must not save the state of children and facets.</strong> That is done via the <A HREF="../../../javax/faces/application/StateManager.html" title="class in javax.faces.application"><CODE>StateManager</CODE></A></p> <p>This method must not alter the state of the implementing object.  In other words, after executing this code:</p> <code><pre> Object state = component.saveState(facesContext); </pre></code> <p><code>component</code> should be the same as before executing it.</p> <p>The return from this method must be <code>Serializable</code></p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/faces/component/StateHolder.html#saveState(javax.faces.context.FacesContext)">saveState</A></CODE> in interface <CODE><A HREF="../../../javax/faces/component/StateHolder.html" title="interface in javax.faces.component">StateHolder</A></CODE></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="setTransient(boolean)"><!-- --></A><H3>setTransient</H3><PRE>public void <B>setTransient</B>(boolean&nbsp;b)</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../javax/faces/component/StateHolder.html#setTransient(boolean)">StateHolder</A></CODE></B></DD><DD><p>Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.</p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/faces/component/StateHolder.html#setTransient(boolean)">setTransient</A></CODE> in interface <CODE><A HREF="../../../javax/faces/component/StateHolder.html" title="interface in javax.faces.component">StateHolder</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>b</CODE> - boolean pass <code>true</code> if this Object   will participate in state saving or restoring, otherwise   pass <code>false</code>.</DL></DD></DL><HR><A NAME="isTransient()"><!-- --></A><H3>isTransient</H3><PRE>public boolean <B>isTransient</B>()</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../javax/faces/component/StateHolder.html#isTransient()">StateHolder</A></CODE></B></DD><DD><p>If true, the Object implementing this interface must not participate in state saving or restoring.</p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/faces/component/StateHolder.html#isTransient()">isTransient</A></CODE> in interface <CODE><A HREF="../../../javax/faces/component/StateHolder.html" title="interface in javax.faces.component">StateHolder</A></CODE></DL></DD><DD><DL></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" 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_bottom_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>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../../javax/faces/convert/DoubleConverter.html" title="class in javax.faces.convert"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../../javax/faces/convert/FloatConverter.html" title="class in javax.faces.convert"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../index.html?javax/faces/convert/EnumConverter.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="EnumConverter.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;&nbsp;<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:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><font size="-1"><a href="http://java.sun.com/webapps/bugreport">Submit a bug or feature</a> <p>Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to <a href="../legal/license.html" target="_top">license terms.</a></font></BODY></HTML>

⌨️ 快捷键说明

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