|[Teneo] Solution for XMLGregorianCalendar problems [message #615517]
||Tue, 19 February 2008 22:11
| Jason Henriksen
Registered: July 2009
I really dislike XMLGregorianCalendar (XGC). It's constantly giving me
ClassCastExceptions and my environment has the IBM, Apache and Sun
versions of these things running around.
I so strongly dislike this class that I wrote and eclipe tool which
automatically refactors any EMF generated objects to switch from using
XMLGregorianCalendar into using the objects from Joda Time
So the refactoring works nicely. My Joda Time methods call wrap the
original EMF getters and setters so that my users never see XGC and EMF
continues to use the objects it expects internally.
Unfortunately, Teneo is pretty much hard coded to use XGC, the same way
EMF is. But it seems like I could make a new property and get this
working by modifying these classes:
AbstractMapper: Switch the defaults based on an option
ECoreDataTypes: Add some methods
XSDDateTime: control behavior by option
XSDDate: control behavior by option
If I have even a hope of you accepting a change like this I'll write it
up and submit it. If you're completely disinterested I'll be forced to
make my wrapper methods @transient, the XGC methods @depricated and then
have my users work via the transient stuff while Teneo works via the
deprecated stuff. I think I can make that work, but it's certainly not
as nice as building the support into Teneo.
I would write the mod as a plug-in so that you wouldn't have to directly
depend on the Joda Time code. Basically, you'd set the option and point
to a 'DateTimeProvider' class that would implement inside the objects
shown above. Then I could offer a JodaDateTimeProvider that would do
what I need.
Let me know what you think. As long as you aren't completely against
the idea I'll write it up and submit it.
Powered by FUDForum
. Page generated in 0.01248 seconds