Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Re: How to customize the date type of xsd in EMF
Re: How to customize the date type of xsd in EMF [message #426342] Sat, 27 December 2008 13:03
Ed Merks is currently offline Ed MerksFriend
Messages: 31152
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit


It's best to ask about EMF using the EMF newsgroup, which I've added to
the "to" list of the reply.

tracy wrote:
> Hi, all
> I meet an issue, if there is date type for a xsd's element, the
> ecore generated by XSDEcoreBuilder will use the default instanceClass
> "javax/xml/datatype/XMLGregorianCalendar" for date type. this class is
> not serializable
Since, EMF provides
an implementation like this:

public final class XMLCalendar extends XMLGregorianCalendar implements

You can use XMLTypeFactory.eINSTANCE.createDate to create instances of it.
> . Now I want to use
> " nCalendarImpl "
> to replace it, Do you know how to complish it?
It's really a JRE question. Likely there is some magical JRE
incantation for replacing which version created by


which EMF uses under the covers and wraps with the above internal
> Is it possible that change the options in to
> change the instanceClass?
No. But I'm a bit confused though, since the instance value doesn't
need to be in order to be saved in a resource...
> BTW: I know if I add the annotation for instanceClass in xsd, it can
> work fine, But I think maybe there is another way.
That's the only way to use a different data type than the one EMF would
use by default.
> Can you help me with this?
I wonder why you need it the data value to be It
shouldn't cause you any problems when saving a resource either way...

It seems to me a bug that the Xerces implementation isn't Serializable....
> Thanks a lot!

Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta content="text/html;charset=ISO-8859-15"
<body bgcolor="#ffffff" text="#000000">
It's best to ask about EMF using the EMF newsgroup, which I've added to
the "to" list of the reply.<br>
tracy wrote:
type="cite">Hi, all
Previous Topic:[CDO] DerbyStore and CLOB
Next Topic:Copyright text isn't regenerated
Goto Forum:

Current Time: Thu May 28 02:23:37 GMT 2020

Powered by FUDForum. Page generated in 0.01997 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top