java.lang.Objectjavax.faces.convert.DateTimeConverter
All Implemented Interfaces:
PartialStateHolder, Converter
Converter implementation for java.util.Date
values.
The getAsObject()
method parses a String into a
java.util.Date
, according to the following algorithm:
null
. Otherwise, trim leading and trailing
whitespace before proceeding.null
.locale
property is not null,
use that Locale
for managing parsing. Otherwise, use the
Locale
from the UIViewRoot
.pattern
has been specified, its syntax must conform
the rules specified by java.text.SimpleDateFormat
. Such
a pattern will be used to parse, and the type
,
dateStyle
, and timeStyle
properties
will be ignored.pattern
has not been specified, parsing will be based
on the type
property, which expects a date value, a time
value, or both. Any date and time values included will be parsed in
accordance to the styles specified by dateStyle
and
timeStyle
, respectively.timezone
has been specified, it must be passed
to the underlying DateFormat
instance. Otherwise
the "GMT" timezone is used.The getAsString()
method expects a value of type
java.util.Date
(or a subclass), and creates a formatted
String according to the following algorithm:
locale
property is not null,
use that Locale
for managing formatting. Otherwise, use the
Locale
from the UIViewRoot
.timezone
has been specified, it must be passed
to the underlying DateFormat
instance. Otherwise
the "GMT" timezone is used.pattern
has been specified, its syntax must conform
the rules specified by java.text.SimpleDateFormat
. Such
a pattern will be used to format, and the type
,
dateStyle
, and timeStyle
properties
will be ignored.pattern
has not been specified, formatting will be
based on the type
property, which includes a date value,
a time value, or both into the formatted String. Any date and time
values included will be formatted in accordance to the styles specified
by dateStyle
and timeStyle
, respectively.Field Summary | ||
---|---|---|
public static final String | CONVERTER_ID | The standard converter id for this converter. |
public static final String | DATE_ID | The message identifier of the javax.faces.application.FacesMessage to be created if
the conversion to
|
public static final String | TIME_ID | The message identifier of the javax.faces.application.FacesMessage to be created if
the conversion to
|
public static final String | DATETIME_ID | The message identifier of the javax.faces.application.FacesMessage to be created if
the conversion to
|
public static final String | STRING_ID | The message identifier of the javax.faces.application.FacesMessage to be created if
the conversion of the
|
Method from javax.faces.convert.DateTimeConverter Summary: |
---|
clearInitialState, getAsObject, getAsString, getDateStyle, getLocale, getPattern, getTimeStyle, getTimeZone, getType, initialStateMarked, isTransient, markInitialState, restoreState, saveState, setDateStyle, setLocale, setPattern, setTimeStyle, setTimeZone, setTransient, setType |
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from javax.faces.convert.DateTimeConverter Detail: |
---|
|
|
|
Return the style to be used to format or parse dates. If not set,
the default value, |
Return the |
Return the format pattern to be used when formatting and parsing dates and times. |
Return the style to be used to format or parse times. If not set,
the default value, |
Return the |
Return the type of value to be formatted or parsed.
If not explicitly set, the default type, |
|
|
|
|
|
Set the style to be used to format or parse dates. Valid values
are |
Set the |
Set the format pattern to be used when formatting and parsing
dates and times. Valid values are those supported by
|
Set the style to be used to format or parse times. Valid values
are |
Set the |
|
Set the type of value to be formatted or parsed.
Valid values are |