View Javadoc

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 DateType
15  	extends SimpleType
16  {
17  	public Object coerceString(String string)
18  	{
19  		return DateUtils.parseDate( string );
20  	}
21      
22  	public String coerceValue(Object value)
23  	{
24          return DateUtils.formatDate((Date)value);
25  	}
26  
27      public QName getDefaultSchemaType()
28      {
29          return QName.get("date", SOAPConstants.XSD);
30      }
31  }