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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidConverts 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.voidsetTimeZone(String timeZone)
-
Field Details
-
datePattern
-
timeZone
-
dateFormat
protected org.apache.commons.lang3.time.FastDateFormat dateFormat
-
-
Constructor Details
-
StringToDateConverter
-
-
Method Details
-
setTimeZone
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
getSourceClass
Description copied from interface:ConverterReturns the class of the objects this converter converts from.- Specified by:
getSourceClassin interfaceConverter<String,Date>
-
getTargetClass
Description copied from interface:ConverterReturns the class of the objects this converter converts to.- Specified by:
getTargetClassin interfaceConverter<String,Date>
-
convert
Description copied from interface:ConverterConverts the source object from S type to T type.
-