|
Re: [Xcore] EcorePackage version issue (in Xtext validator) [message #1751056 is a reply to message #1751039] |
Wed, 04 January 2017 06:43 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
It's best not to assume that EcorePackage.eINSTANCE will necessarily be the only one used. The serialized Ecore.ecore can be loaded as a resource into any resource set. Even the Sample Ecore Editor the Load Resource... gives you a choice, i.e., Browse Target Platform Packages... will load the serialized Ecore.ecore into a resource. Xcore tries to consistently use EPackages from the target platform in all cases; I say tries, because an Ecore model may reference either one which is why GenPackageImpl has a method like this:
public boolean isEcorePackage()
{
return (EcorePackage.eNS_URI.equals(getNSURI()));
} I don't know the full context of your application, perhaps you should be testing that operand.expressionType.instanceClass is the class for "boolean" or that operand.expressionType.instanceClassName is the value "boolean". After all, XMLTypePackage.Literals.BOOLEAN is also an EDataType that wraps "boolean" and of course any model could provide a different wrapper (and even serialize the instance value differently).
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03123 seconds