org.javalite.activejdbc.conversion
Class StringToTimestampConverter
java.lang.Object
org.javalite.activejdbc.conversion.ConverterAdapter<String,Timestamp>
org.javalite.activejdbc.conversion.StringToTimestampConverter
- All Implemented Interfaces:
- Converter<String,Timestamp>
public class StringToTimestampConverter
- extends ConverterAdapter<String,Timestamp>
Converts instances of String to Timestamp. This class is thread-safe.
- Author:
- Eric Nielsen
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StringToTimestampConverter
public StringToTimestampConverter(String pattern)
- Parameters:
pattern - pattern to use for conversion
StringToTimestampConverter
public StringToTimestampConverter(DateFormat format)
- Parameters:
format - DateFormat to use for conversion
sourceClass
protected Class<String> sourceClass()
- Specified by:
sourceClass in class ConverterAdapter<String,Timestamp>
destinationClass
protected Class<Timestamp> destinationClass()
- Specified by:
destinationClass in class ConverterAdapter<String,Timestamp>
doConvert
public Timestamp doConvert(String source)
throws ParseException
- Description copied from class:
ConverterAdapter
- Converts instance of S to T.
- Specified by:
doConvert in class ConverterAdapter<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
Copyright © 2015 JavaLite. All rights reserved.