public class DateTimeConverter extends AbstractConverter
Date
and its
java.sql subtypes, String and Long. Long is treated as UTC.
By default this converter uses the jvm date time formats,
if pattern is not specified.
Use TimeConverter
or DateConverter
to default to
jvm date or time formats.
This class accepts patterns specified in SimpleDateFormat
or
the string "ISO8601" for ISO-8601 format pattern.
Date
Modifier and Type | Class and Description |
---|---|
protected static class |
DateTimeConverter.ISO8601DateTimeFormat
Implementation of DateFormat for ISO-8601 parsing and formatting.
|
Modifier and Type | Field and Description |
---|---|
static String |
PATTERN_ISO_8601 |
Constructor and Description |
---|
DateTimeConverter() |
Modifier and Type | Method and Description |
---|---|
protected DateFormat |
createDateFormat(Locale locale,
String pattern)
Creates the DateFormat for the given locale and pattern.
|
protected <T> T |
doConversion(Class<T> type,
Object value,
Locale locale,
String pattern)
Converts the specified input object into an output object of the
specified type.
|
convert, convert, convert, doesNullValueReturnNull, doesValueInstanceOfTypeReturnValue, getDefaultLocale, getDefaultPattern, setDefaultLocale, setDefaultPattern, setFallbackToRegisteredConverters, shouldFallbackToRegisteredConverters
public static final String PATTERN_ISO_8601
protected DateFormat createDateFormat(Locale locale, String pattern)
locale
- the locale.pattern
- the pattern.DateFormat
protected <T> T doConversion(Class<T> type, Object value, Locale locale, String pattern) throws UnsupportedConversionTypeException
AbstractConverter
doConversion
in class AbstractConverter
T
- generics support for the data type specified.type
- data type to which the value should be converted.value
- the input value to be converted.locale
- locale to be used during conversion, if necessary.pattern
- converter specific conversion pattern, to be used during conversion, if necessary.UnsupportedConversionTypeException
- if this converter does not supports converting to the specified type.LumisXP 12.4.0.200625 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.