Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 330073 - [typesystem] Enable Xtend transformation for EMF Java types
Summary: [typesystem] Enable Xtend transformation for EMF Java types
Status: CLOSED WONTFIX
Alias: None
Product: M2T
Classification: Modeling
Component: Xpand (show other bugs)
Version: 1.0.1   Edit
Hardware: Macintosh Mac OS X
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-12 06:20 EST by Karsten Thoms CLA
Modified: 2020-04-30 13:54 EDT (History)
0 users

See Also:


Attachments
Proposed Solution (9.89 KB, application/octet-stream)
2010-11-12 06:23 EST, Karsten Thoms CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Karsten Thoms CLA 2010-11-12 06:20:30 EST
Xtend is not capable of instantiating EMF Java types in an Xtend transformation. The JavaBeansMetaModel assumes that classes have a default constructor, which is not true for EMF generated classes. If it is desired to instantiate EMF types the only possibility is to use the EMF typesystem.

Find attached a possible solution for this problem. The EMFJavaMetaModel extends the JavaMetaModel in a way that it is capable of instantiating EMF Java types. Therefore it is required to identify the EClass that corresonds to an EMF generated interface or implementation class. Through this the appropriate factory can be used to instantiate the type. Also the isAbstract() method should query the EClass. The EMFJavaMetaModel uses heuristics to locate the appropriate EClass for EMF generated types.

The implementation could be optimized by delegating functionality to the JavaTypeStrategy. Therefore the interface must by extended by two new methods
- newInstance()
- isAbstract
and the JavaTypeImpl should delegate to that (maybe subtyped specialized) interface.

The EDNA project makes use of this functionality. Find a transformation form UML to XSD using the XSD Infoset EMF implementation here:
http://www.edna-site.org/svn/trunk/rcp/org.edna.uml2xsd
Comment 1 Karsten Thoms CLA 2010-11-12 06:23:37 EST
Created attachment 182980 [details]
Proposed Solution
Comment 2 Karsten Thoms CLA 2020-04-30 13:54:31 EDT
This is a batch close of open M2T Xpand bugs. It is not planned work on this component in the foreseeable future. If you think this issue needs to be solved and you plan to contribute a fix then feel free to reopen it.