users@jaxb.java.net

Re: Union with date and dateTime

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Tue, 21 Oct 2003 08:25:47 -0700

The problem is, both xs:dateTime and xs:date maps to java.util.Calendar,
and therefore when you are marshalling them back, they are
indistinguishable.

The simplest way to work around this it to use <javaType> customization
and specify your own parse/print methods.

your print method can "sniff" Calendar object and decide the type, then
you can use the javax.xml.bind.DatatypeConverter interface to do the
actual hard work.


regards,
--
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net