Class StringToDateConverter
java.lang.Object
org.craftercms.commons.converters.impl.StringToDateConverter
- All Implemented Interfaces:
Converter<String,
,Date> org.springframework.beans.factory.InitializingBean
public class StringToDateConverter
extends Object
implements Converter<String,Date>, org.springframework.beans.factory.InitializingBean
Converts String to Date, with a custom pattern and time zone.
- Author:
- avasquez
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Converts the source object from S type to T type.Class<?>
Returns the class of the objects this converter converts from.Class<?>
Returns the class of the objects this converter converts to.void
setDatePattern
(String datePattern) void
setTimeZone
(String timeZone)
-
Field Details
-
datePattern
-
timeZone
-
dateFormat
protected org.apache.commons.lang3.time.FastDateFormat dateFormat
-
-
Constructor Details
-
StringToDateConverter
public StringToDateConverter()
-
-
Method Details
-
setDatePattern
-
setTimeZone
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-
getSourceClass
Description copied from interface:Converter
Returns the class of the objects this converter converts from.- Specified by:
getSourceClass
in interfaceConverter<String,
Date>
-
getTargetClass
Description copied from interface:Converter
Returns the class of the objects this converter converts to.- Specified by:
getTargetClass
in interfaceConverter<String,
Date>
-
convert
Description copied from interface:Converter
Converts the source object from S type to T type.
-