1
votes

I'm trying to create some Java classes from my ECore Model. In this model, some classes must implement Iterable<Something>. To make this happen, I added a EClass Iterable and set its Instance Type Name to java.lang.Iterable. This prevents the ECore Code Generator from generating code for Iterable while still allowing me to use it a ESuper Types for the classes which I want to implement this interface

Is this the right way to do it?

The problem with this approach is, that all editors (I tried the "Sample Reflective eCore Editor" and the "Generic EMF Form Editor" fail to edit a instance of the Model. Both editors are unable to find the Iterable type and show a error "Class 'Iterable' is a unkown classifier".

Is there a workaround or a solution for this?

1

1 Answers

0
votes

No I don't think that is right. You should use the @extends annotation to the class comment section for any place you want to add an external Java interface. That way your interface will not get blown away during generation. This is from page 308 (Section 10.11) of EMF book:

/**
 * <!-- begin-user-doc -->
 * A representation of the model object 'PurchaseOrder'.
 * @extends Serializable
 * <!-- end-user-doc -->
 *
 *

 * @model
 * @generated
 */
public interface PurchaseOrder extends EObject, Serializable
 {...