Skip to main content



      Home
Home » Modeling » M2T (model-to-text transformation) » [Xtend]: definition of recursive extensions
[Xtend]: definition of recursive extensions [message #552249] Wed, 11 August 2010 08:47 Go to next message
Eclipse UserFriend
Hello

I have an error on my ext file:
Couldn't find extension : getWebApp(c.eContainer)

I think it's related to:

DataTable getDataTable(Column col):
getDataTable(col.eContainer);
DataTable getDataTable(DataTable d):
d;
DataTable getDataTable(EObject e):
null;

I have also proble with the extend editor: it doesn't underline the wright line with the error.

Thanks
Re: [Xtend]: definition of recursive extensions [message #552256 is a reply to message #552249] Wed, 11 August 2010 09:04 Go to previous messageGo to next message
Eclipse UserFriend
ElArbi wrote on Wed, 11 August 2010 14:47
Hello

I have an error on my ext file:
Couldn't find extension : getWebApp(c.eContainer)

DataTable getDataTable(Column col):
getDataTable(col.eContainer);
DataTable getDataTable(DataTable d):
d;
DataTable getDataTable(EObject e):
null;


Copy & Paste error?
getWebApp != getDataTable
You need a extension like this:
getWebApp(Object o):
null;

Quote:

I have also proble with the extend editor: it doesn't underline the wright line with the error.


I have checked this with a little example. The extension is marked correct.
What does your editor do?

Regards
Darius
Re: [Xtend]: definition of recursive extensions [message #552693 is a reply to message #552256] Fri, 13 August 2010 04:17 Go to previous messageGo to next message
Eclipse UserFriend
Excellent it works with Object e.g.:
DataTable getDataTable(Column col):
getDataTable(col.eContainer);
DataTable getDataTable(DataTable d):
d;
DataTable getDataTable(Object e):
null;


But why it is not working for EObject ?
Which metamodel is 'Object' from ?

thanks
Re: [Xtend]: definition of recursive extensions [message #552700 is a reply to message #552693] Fri, 13 August 2010 04:37 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

Object is from the Xpand internal Typesystem.
EObject may not work since you may use ecore::EObject ??? but you have to use emf::EObject to get it working.
For analyzing the hierarchies the extensions .metaType and .metaType.superTypes may be useful.

Regards
Christian

[Updated on: Fri, 13 August 2010 04:40] by Moderator

Re: [Xtend]: definition of recursive extensions [message #553612 is a reply to message #552700] Wed, 18 August 2010 04:18 Go to previous messageGo to next message
Eclipse UserFriend
You mean that the emf metamodel is not the ecore metamodel in eclipse?
Re: [Xtend]: definition of recursive extensions [message #553618 is a reply to message #553612] Wed, 18 August 2010 04:30 Go to previous message
Eclipse UserFriend
hi,

the namespace ecore is for working with the ecore itself: e.g. when processing an .ecore file as model and working with EClass EAttribute EReference and so on.

If you just want to refer to the parent of an instance these (e.g. an EClass Model) you have to use the namespace emf and therein emf::EObject - this is just a technical thing (cause every metaclass inherits from EObject)

~Christian

[Updated on: Wed, 18 August 2010 04:35] by Moderator

Previous Topic:[XPand / XText] Calling XPand template Generation from eclipse Plugin Event Handler
Next Topic:[JET] Output not placed under src
Goto Forum:
  


Current Time: Wed Jul 23 08:12:27 EDT 2025

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

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

Back to the top