Community
Participate
Working Groups
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
Created attachment 182980 [details] Proposed Solution
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.