1 package org.codehaus.xfire.aegis.type;
2
3 import java.util.Date;
4
5 import org.codehaus.xfire.SOAPConstants;
6 import org.codehaus.xfire.util.DateUtils;
7 import org.dom4j.QName;
8
9 /***
10 * DateType
11 *
12 * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
13 */
14 public class DateTimeType
15 extends SimpleType
16 {
17
18 public Object coerceString(String string)
19 {
20 return DateUtils.parseDateTime( string );
21 }
22
23 public String coerceValue(Object value)
24 {
25 return DateUtils.formatDateTime((Date)value);
26 }
27
28 public QName getDefaultSchemaType()
29 {
30 return QName.get("dateTime", SOAPConstants.XSD);
31 }
32 }