Class AbstractDateConverter<D extends Date>
- java.lang.Object
-
- org.apache.wicket.util.convert.converter.AbstractConverter<D>
-
- org.apache.wicket.util.convert.converter.AbstractDateConverter<D>
-
- Type Parameters:
D
- the type of the Date that is supported by this converter
- All Implemented Interfaces:
Serializable
,IConverter<D>
,IClusterable
- Direct Known Subclasses:
DateConverter
,SqlDateConverter
,SqlTimeConverter
,SqlTimestampConverter
public abstract class AbstractDateConverter<D extends Date> extends AbstractConverter<D>
A base class for all Date related converters- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractDateConverter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description D
convertToObject(String value, Locale locale)
Converts the givenString
valueString
convertToString(D value, Locale locale)
Converts the given value to a string.protected abstract D
createDateLike(long date)
Creates a new instance of D out of the passed date(time) as longDateFormat
getDateFormat(Locale locale)
-
Methods inherited from class org.apache.wicket.util.convert.converter.AbstractConverter
getTargetType, newConversionException, parse
-
-
-
-
Constructor Detail
-
AbstractDateConverter
public AbstractDateConverter()
-
-
Method Detail
-
createDateLike
protected abstract D createDateLike(long date)
Creates a new instance of D out of the passed date(time) as long- Parameters:
date
- the date(time) in millis since Epoch- Returns:
- a new instance of the specific type D
-
convertToObject
public D convertToObject(String value, Locale locale)
Description copied from interface:IConverter
Converts the givenString
value- Parameters:
value
- The string value to convertlocale
- The locale used to convert the value- Returns:
- The converted value
-
convertToString
public String convertToString(D value, Locale locale)
Description copied from interface:IConverter
Converts the given value to a string.- Specified by:
convertToString
in interfaceIConverter<D extends Date>
- Overrides:
convertToString
in classAbstractConverter<D extends Date>
- Parameters:
value
- The value to convertlocale
- The locale used to convert the value- Returns:
- The converted string value
- See Also:
IConverter.convertToString(java.lang.Object, Locale)
-
getDateFormat
public DateFormat getDateFormat(Locale locale)
- Parameters:
locale
-- Returns:
- Returns the date format.
-
-