Package org.javalite.conversion
Class StringToTimestampConverter
java.lang.Object
org.javalite.conversion.ConverterAdapter<String,Timestamp>
org.javalite.conversion.StringToTimestampConverter
- Author:
- Eric Nielsen
-
Constructor Summary
ConstructorDescriptionStringToTimestampConverter(String pattern)
StringToTimestampConverter(DateFormat format)
-
Method Summary
Modifier and TypeMethodDescriptionConverts instance of S to T.Methods inherited from class org.javalite.conversion.ConverterAdapter
canConvert, convert
-
Constructor Details
-
StringToTimestampConverter
- Parameters:
pattern
- pattern to use for conversion
-
StringToTimestampConverter
- Parameters:
format
- DateFormat to use for conversion
-
-
Method Details
-
sourceClass
- Specified by:
sourceClass
in classConverterAdapter<String,Timestamp>
-
destinationClass
- Specified by:
destinationClass
in classConverterAdapter<String,Timestamp>
-
doConvert
Description copied from class:ConverterAdapter
Converts instance of S to T.- Specified by:
doConvert
in classConverterAdapter<String,Timestamp>
- Parameters:
source
- instance of String or null- Returns:
- source converted to java.sql.Timestamp, or null if source is blank
- Throws:
ParseException
- if conversion failed
-