1 29 30 package com.caucho.jaxb.skeleton; 31 import javax.xml.bind.DatatypeConverter; 32 import javax.xml.stream.XMLStreamException; 33 import java.io.IOException ; 34 import java.util.Calendar ; 35 36 39 public class DateProperty extends CDataProperty { 40 public static final DateProperty PROPERTY = new DateProperty(); 41 42 protected String write(Object in) 43 throws IOException , XMLStreamException 44 { 45 return DatatypeConverter.printDate((Calendar ) in); 46 } 47 48 protected Object read(String in) 49 throws IOException , XMLStreamException 50 { 51 return DatatypeConverter.parseDate(in); 52 } 53 54 public String getSchemaType() 55 { 56 return "xsd:date"; 57 } 58 } 59 | Popular Tags |