KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > thoughtworks > xstream > converters > extended > SqlTimestampConverter


1 package com.thoughtworks.xstream.converters.extended;
2
3 import com.thoughtworks.xstream.converters.basic.AbstractBasicConverter;
4
5 import java.sql.Timestamp JavaDoc;
6
7 /**
8  * Converts a java.sql.Timestamp to text.
9  *
10  * @author Joe Walnes
11  */

12 public class SqlTimestampConverter extends AbstractBasicConverter {
13
14     protected Object JavaDoc fromString(String JavaDoc str) {
15         return Timestamp.valueOf(str);
16     }
17
18     public boolean canConvert(Class JavaDoc type) {
19         return type.equals(Timestamp JavaDoc.class);
20     }
21
22 }
23
Popular Tags