public abstract class DateConverter extends Object implements IConverter<Date>
Converters of this class are best suited for per-component use.
Constructor and Description |
---|
DateConverter(boolean applyTimeZoneDifference)
Construct.
|
Modifier and Type | Method and Description |
---|---|
Date |
convertToObject(String value,
Locale locale)
Converts the given
String value |
String |
convertToString(Date value,
Locale locale)
Converts the given value to a string.
|
boolean |
getApplyTimeZoneDifference()
Gets whether to apply the time zone difference when interpreting dates.
|
protected TimeZone |
getClientTimeZone()
Gets the client's time zone.
|
abstract String |
getDatePattern(Locale locale) |
protected abstract org.joda.time.format.DateTimeFormatter |
getFormat(Locale locale) |
protected org.joda.time.DateTimeZone |
getTimeZone()
Gets the server time zone.
|
public DateConverter(boolean applyTimeZoneDifference)
applyTimeZoneDifference
- whether to apply the difference in time zones between client and serverpublic Date convertToObject(String value, Locale locale)
IConverter
String
valueconvertToObject
in interface IConverter<Date>
value
- The string value to convertlocale
- The locale used to convert the valueIConverter.convertToObject(java.lang.String,
java.util.Locale)
public String convertToString(Date value, Locale locale)
IConverter
convertToString
in interface IConverter<Date>
value
- The value to convertlocale
- The locale used to convert the valueIConverter.convertToString(java.lang.Object,
java.util.Locale)
public final boolean getApplyTimeZoneDifference()
public abstract String getDatePattern(Locale locale)
locale
- The locale used to convert the valueprotected TimeZone getClientTimeZone()
protected abstract org.joda.time.format.DateTimeFormatter getFormat(Locale locale)
locale
- The locale used to convert the valueprotected org.joda.time.DateTimeZone getTimeZone()
Copyright © 2006–2021 Apache Software Foundation. All rights reserved.