converter.html

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

HTML
295
字号
<!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:52 PST 2008 --><TITLE>Converter (Java EE 5)</TITLE><META NAME="keywords" CONTENT="javax.faces.convert.Converter interface"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){    parent.document.title="Converter (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>&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/CharacterConverter.html" title="class in javax.faces.convert"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../../javax/faces/convert/ConverterException.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/Converter.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="Converter.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;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<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.convert</FONT><BR>Interface Converter</H2><DL><DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../javax/faces/convert/BigDecimalConverter.html" title="class in javax.faces.convert">BigDecimalConverter</A>, <A HREF="../../../javax/faces/convert/BigIntegerConverter.html" title="class in javax.faces.convert">BigIntegerConverter</A>, <A HREF="../../../javax/faces/convert/BooleanConverter.html" title="class in javax.faces.convert">BooleanConverter</A>, <A HREF="../../../javax/faces/convert/ByteConverter.html" title="class in javax.faces.convert">ByteConverter</A>, <A HREF="../../../javax/faces/convert/CharacterConverter.html" title="class in javax.faces.convert">CharacterConverter</A>, <A HREF="../../../javax/faces/convert/DateTimeConverter.html" title="class in javax.faces.convert">DateTimeConverter</A>, <A HREF="../../../javax/faces/convert/DoubleConverter.html" title="class in javax.faces.convert">DoubleConverter</A>, <A HREF="../../../javax/faces/convert/EnumConverter.html" title="class in javax.faces.convert">EnumConverter</A>, <A HREF="../../../javax/faces/convert/FloatConverter.html" title="class in javax.faces.convert">FloatConverter</A>, <A HREF="../../../javax/faces/convert/IntegerConverter.html" title="class in javax.faces.convert">IntegerConverter</A>, <A HREF="../../../javax/faces/convert/LongConverter.html" title="class in javax.faces.convert">LongConverter</A>, <A HREF="../../../javax/faces/convert/NumberConverter.html" title="class in javax.faces.convert">NumberConverter</A>, <A HREF="../../../javax/faces/convert/ShortConverter.html" title="class in javax.faces.convert">ShortConverter</A></DD></DL><HR><DL><DT><PRE>public interface <B>Converter</B></DL></PRE><P><p><strong>Converter</strong> is an interface describing a Java class that can perform Object-to-String and String-to-Object conversions between model data objects and a String representation of those objects that is suitable for rendering.</p> <p><A HREF="../../../javax/faces/convert/Converter.html" title="interface in javax.faces.convert"><CODE>Converter</CODE></A> implementations must have a zero-arguments public constructor.  In addition, if the <A HREF="../../../javax/faces/convert/Converter.html" title="interface in javax.faces.convert"><CODE>Converter</CODE></A> class wishes to have configuration property values saved and restored with the component tree, the implementation must also implement <A HREF="../../../javax/faces/component/StateHolder.html" title="interface in javax.faces.component"><CODE>StateHolder</CODE></A>.</p> <p>Starting with version 1.2 of the specification, an exception to the above  zero-arguments constructor requirement has been introduced.  If a converter has a single argument constructor that takes a <code>Class</code> instance and the <code>Class</code> of the data to be converted is known at converter instantiation time, this constructor must be used to instantiate the converter instead of the zero-argument version.  This enables the per-class conversion of Java enumerated types.</p> <p>If any <code>Converter</code> implementation requires a <code>java.util.Locale</code> to perform its job, it must obtain that <code>Locale</code> from the <A HREF="../../../javax/faces/component/UIViewRoot.html" title="class in javax.faces.component"><CODE>UIViewRoot</CODE></A> of the current <A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context"><CODE>FacesContext</CODE></A>, unless the <code>Converter</code> maintains its own <code>Locale</code> as part of its state.</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>&nbsp;<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/convert/Converter.html#getAsObject(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.String)">getAsObject</A></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/String.html" title="class or interface in java.lang">String</A>&nbsp;value)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Convert the specified string value, which is associated with the specified <A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component"><CODE>UIComponent</CODE></A>, into a model data object that

⌨️ 快捷键说明

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