|Re: equals-operation on custom datatypes [message #513293 is a reply to message #513214]
||Tue, 09 February 2010 11:46
| Sven Efftinge
Registered: July 2009
Xtend (and Xpand) have four built-in datatypes, String being one of |
them. In the metamodel you can map implementation-specific datatypes to
those built-in types. For instance the EmfRegistryMetamodel maps
ecore::EString to the builtin String, the UML2 meta model maps
uml2::String to it.
You'll have to do the same if you really need this custom String.
> Hi all,
> I was directed to this forum with my question, though I'm not really
> sure it is the correct place to ask. I'm just hoping someone can help me.
> I created a custom datatype to represent Strings, let's call it XString.
> I did this so that I could put a constraints on the allowed characters
> in the XString. So I added a datatype to my Ecore model, and set the
> Instance Class Name to java.lang.String
> However, now I get an error when I want to compare XStrings in .ext files:
> Could find operation '==(Model::XString)' for type 'Model:XString'
> While it is true that I did not define this operation, I kind of hoped
> it was implied by setting the instance class to java.lang.String. But
> apparently this is not the case.
> So my question now is, what to do? Where do I define the equals
> operation? Or do I have to link my datatype to the standard String
> datatype in another way?
> Thanks in advance
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Powered by FUDForum
. Page generated in 0.02588 seconds