XJC like bindings?

34 views
Skip to first unread message

apschexn

unread,
Mar 26, 2012, 11:45:17 AM3/26/12
to scalaxb
Is it possible or is it planned to have XJC like bindings for scalaxb?
For example I have hundreds of schema files with date elements
expressed in various string formats and I would like the properties of
the generated classes to be actual Dates

-Anthony

eugene yokota

unread,
Mar 26, 2012, 12:33:33 PM3/26/12
to sca...@googlegroups.com
You can control some aspect of data binding by customizing the typeclass,
but currently there's no much support of the customizing the generated class.

Dates are tricky because there's no good date class in Java that supports,
timezone, time, dates, etc separately.
This is necessary because XML Schema Part 2 defines a whole series of
builtin types
like gYearMonth and gMonthDay.

Current design allows me to output XML using sclaxb.toXML for both
schema-originated
types and built-in types. If I made everything into some kind of
Calendar/DateTime class,
it won't be able to round trip back to XML.

scalaxb.toXML[Calendar](x, None, Some("foo"), defaultScope); //
dateTime, gYearMonth, etc?

XMLGregorianCalendar is nice because the capability is built into the class.

-eugene

Reply all
Reply to author
Forward
0 new messages