org.javalite.activejdbc.conversion
Class StringToSqlDateConverter
java.lang.Object
org.javalite.activejdbc.conversion.ConverterAdapter<String,Date>
org.javalite.activejdbc.conversion.StringToSqlDateConverter
- All Implemented Interfaces:
- Converter<String,Date>
public class StringToSqlDateConverter
- extends ConverterAdapter<String,Date>
Converts instances of String to Date. 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 |
StringToSqlDateConverter
public StringToSqlDateConverter(String pattern)
- Parameters:
pattern - pattern to use for conversion
StringToSqlDateConverter
public StringToSqlDateConverter(DateFormat format)
- Parameters:
format - DateFormat to use for conversion
sourceClass
protected Class<String> sourceClass()
- Specified by:
sourceClass in class ConverterAdapter<String,Date>
destinationClass
protected Class<Date> destinationClass()
- Specified by:
destinationClass in class ConverterAdapter<String,Date>
doConvert
public Date doConvert(String source)
throws ParseException
- Description copied from class:
ConverterAdapter
- Converts instance of S to T.
- Specified by:
doConvert in class ConverterAdapter<String,Date>
- Parameters:
source - instance of String or null
- Returns:
- source converted to java.sql.Date, or null if source is blank
- Throws:
ParseException - if conversion failed
Copyright © 2015 JavaLite. All rights reserved.