|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.wicket.datetime.DateConverter
public abstract class DateConverter
Base class for Joda Time based date converters. It contains the logic to parse and format, optionally taking the time zone difference between clients and the server into account.
Converters of this class are best suited for per-component use.
Constructor Summary | |
---|---|
DateConverter(boolean applyTimeZoneDifference)
Construct. |
Method Summary | |
---|---|
Date |
convertToObject(String value,
Locale locale)
Converts the given String value |
String |
convertToString(Object 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. |
Component |
getComponent()
|
abstract String |
getDatePattern()
|
protected abstract org.joda.time.format.DateTimeFormatter |
getFormat()
|
protected Locale |
getLocale()
Gets the locale to use. |
protected org.joda.time.DateTimeZone |
getTimeZone()
Gets the server time zone. |
void |
setComponent(Component component)
Sets component for getting the locale |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DateConverter(boolean applyTimeZoneDifference)
applyTimeZoneDifference
- whether to apply the difference in time zones between client and serverMethod Detail |
---|
public Date convertToObject(String value, Locale locale)
IConverter
String
value
convertToObject
in interface IConverter
value
- The string value to convertlocale
- The locale used to convert the value
IConverter.convertToObject(java.lang.String,
java.util.Locale)
public String convertToString(Object value, Locale locale)
IConverter
convertToString
in interface IConverter
value
- The value to convertlocale
- The locale used to convert the value
IConverter.convertToString(java.lang.Object,
java.util.Locale)
public final boolean getApplyTimeZoneDifference()
public final Component getComponent()
public abstract String getDatePattern()
public final void setComponent(Component component)
component
- optional component to use for determining the locale.protected TimeZone getClientTimeZone()
protected abstract org.joda.time.format.DateTimeFormatter getFormat()
protected Locale getLocale()
protected org.joda.time.DateTimeZone getTimeZone()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |