datetimeconverter.html
来自「j2ee帮助文档软件设计/软件工程 文件格式」· HTML 代码 · 共 994 行 · 第 1/4 页
HTML
994 行
<DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.faces.convert.DateTimeConverter.DATETIME_ID">Constant Field Values</A></DL></DL><HR><A NAME="STRING_ID"><!-- --></A><H3>STRING_ID</H3><PRE>public static final <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>STRING_ID</B></PRE><DL><DD><p>The message identifier of the <A HREF="../../../javax/faces/application/FacesMessage.html" title="class in javax.faces.application"><CODE>FacesMessage</CODE></A> to be created if the conversion of the <code>DateTime</code> value to <code>String</code> fails. The message format string for this message may optionally include the following placeholders: <ul> <li><code>{0}</code> relaced by the unconverted value.</li> <li><code>{1}</code> replaced by a <code>String</code> whose value is the label of the input component that produced this message.</li> </ul></p><P><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.faces.convert.DateTimeConverter.STRING_ID">Constant Field Values</A></DL></DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_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>Constructor Detail</B></FONT></TH></TR></TABLE><A NAME="DateTimeConverter()"><!-- --></A><H3>DateTimeConverter</H3><PRE>public <B>DateTimeConverter</B>()</PRE><DL></DL><!-- ============ 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="getDateStyle()"><!-- --></A><H3>getDateStyle</H3><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>getDateStyle</B>()</PRE><DL><DD><p>Return the style to be used to format or parse dates. If not set, the default value, <code>default<code>, is returned.</p><P><DD><DL></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="setDateStyle(java.lang.String)"><!-- --></A><H3>setDateStyle</H3><PRE>public void <B>setDateStyle</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> dateStyle)</PRE><DL><DD><p>Set the style to be used to format or parse dates. Valid values are <code>default</code>, <code>short</code>, <code>medium</code>, <code>long</code>, and <code>full</code>. An invalid value will cause a <A HREF="../../../javax/faces/convert/ConverterException.html" title="class in javax.faces.convert"><CODE>ConverterException</CODE></A> when <code>getAsObject()</code> or <code>getAsString()</code> is called.</p><P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>dateStyle</CODE> - The new style code</DL></DD></DL><HR><A NAME="getLocale()"><!-- --></A><H3>getLocale</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/util/Locale.html" title="class or interface in java.util">Locale</A> <B>getLocale</B>()</PRE><DL><DD><p>Return the <code>Locale</code> to be used when parsing or formatting dates and times. If not explicitly set, the <code>Locale</code> stored in the <A HREF="../../../javax/faces/component/UIViewRoot.html" title="class in javax.faces.component"><CODE>UIViewRoot</CODE></A> for the current request is returned.</p><P><DD><DL></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="setLocale(java.util.Locale)"><!-- --></A><H3>setLocale</H3><PRE>public void <B>setLocale</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/util/Locale.html" title="class or interface in java.util">Locale</A> locale)</PRE><DL><DD><p>Set the <code>Locale</code> to be used when parsing or formatting dates and times. If set to <code>null</code>, the <code>Locale</code> stored in the <A HREF="../../../javax/faces/component/UIViewRoot.html" title="class in javax.faces.component"><CODE>UIViewRoot</CODE></A> for the current request will be utilized.</p><P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>locale</CODE> - The new <code>Locale</code> (or <code>null</code>)</DL></DD></DL><HR><A NAME="getPattern()"><!-- --></A><H3>getPattern</H3><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>getPattern</B>()</PRE><DL><DD><p>Return the format pattern to be used when formatting and parsing dates and times.</p><P><DD><DL></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="setPattern(java.lang.String)"><!-- --></A><H3>setPattern</H3><PRE>public void <B>setPattern</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> pattern)</PRE><DL><DD><p>Set the format pattern to be used when formatting and parsing dates and times. Valid values are those supported by <code>java.text.SimpleDateFormat</code>. An invalid value will cause a <A HREF="../../../javax/faces/convert/ConverterException.html" title="class in javax.faces.convert"><CODE>ConverterException</CODE></A> when <code>getAsObject()</code> or <code>getAsString()</code> is called.</p><P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>pattern</CODE> - The new format pattern</DL></DD></DL><HR><A NAME="getTimeStyle()"><!-- --></A><H3>getTimeStyle</H3><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>getTimeStyle</B>()</PRE><DL><DD><p>Return the style to be used to format or parse times. If not set, the default value, <code>default</code>, is returned.</p><P><DD><DL></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="setTimeStyle(java.lang.String)"><!-- --></A><H3>setTimeStyle</H3><PRE>public void <B>setTimeStyle</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> timeStyle)</PRE><DL><DD><p>Set the style to be used to format or parse times. Valid values are <code>default</code>, <code>short</code>, <code>medium</code>, <code>long</code>, and <code>full</code>. An invalid value will cause a <A HREF="../../../javax/faces/convert/ConverterException.html" title="class in javax.faces.convert"><CODE>ConverterException</CODE></A> when <code>getAsObject()</code> or <code>getAsString()</code> is called.</p><P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>timeStyle</CODE> - The new style code</DL></DD></DL><HR><A NAME="getTimeZone()"><!-- --></A><H3>getTimeZone</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/util/TimeZone.html" title="class or interface in java.util">TimeZone</A> <B>getTimeZone</B>()</PRE><DL><DD><p>Return the <code>TimeZone</code> used to interpret a time value. If not explicitly set, the default time zone of <code>GMT</code> returned.</p><P><DD><DL></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="setTimeZone(java.util.TimeZone)"><!-- --></A><H3>setTimeZone</H3><PRE>public void <B>setTimeZone</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/util/TimeZone.html" title="class or interface in java.util">TimeZone</A> timeZone)</PRE><DL><DD><p>Set the <code>TimeZone</code> used to interpret a time value.</p><P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>timeZone</CODE> - The new time zone</DL></DD></DL><HR><A NAME="getType()"><!-- --></A><H3>getType</H3><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>getType</B>()</PRE><DL><DD><p>Return the type of value to be formatted or parsed. If not explicitly set, the default type, <code>date</code> is returned.</p><P><DD><DL></DL></DD><DD><DL></DL></DD>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?