KickJava   Java API By Example, From Geeks To Geeks.

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


1 package com.thoughtworks.xstream.converters.extended;
2
3 import com.thoughtworks.xstream.converters.basic.AbstractBasicConverter;
4
5 import java.sql.Time JavaDoc;
6
7 /**
8  * Converts a java.sql.Time to text. Warning: Any granularity smaller than seconds is lost.
9  *
10  * @author Jose A. Illescas
11  */

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