[Xtend] Support for http://www.eclipse.org/emf/2003/XMLType dataTypes [message #634397] |
Thu, 21 October 2010 10:40  |
Eclipse User |
|
|
|
I have an existing ecore model that uses the types defined in the http://www.eclipse.org/emf/2003/XMLType package (since it was once was imported from xsd).
Is there any existing support (that I can enable or use) for those types in Xtend?
For the types I've used so far (Name, String, Int) things seem to work at runtime (I think because the EMF metadamodel has a java metadatamodel as a backup), but my xtend files are full of errors.
If I do something like this, where name is http://www.eclipse.org/emf/2003/XMLType#Name
switch(something.name){
case 'abc' : info('abc')
case 'xyz' : info('xyz')
default : info('unknown')
}
I get errors on the case statements saying "java::lang::String expected!" (but it works at runtime)
The same kind of thing happens for functions.
|
|
|
Re: [Xtend] Support for http://www.eclipse.org/emf/2003/XMLType dataTypes [message #638535 is a reply to message #634397] |
Thu, 11 November 2010 10:22  |
Eclipse User |
|
|
|
To help anyone coming across this later:
1.) I believe it is possible to extend xtend to handle these types. I know some of that functionality is in the 'XSD Adapter' (the problem is, I'm working with an Ecore model I created from XSD, not the actual xsd).
2.) I don't know how to do it.
3.) Although reading from the model seemed to work fine at runtime, and just cause errors in the syntax UI, writing to the model did not work at runtime. The easiest work around for all of this was to do a search and replace in my Ecore (as text), and just replace all the XML types with equivalent core Ecore types.
|
|
|
Powered by
FUDForum. Page generated in 0.03704 seconds