eclipseemfmdaecore

Defining my own datatypes within my own metamodel using EMF Ecore


I was wondering how can I define my own datatypes within a metamodel created using EMF Ecore ?

The goal is to have a class that may contain many attribute. Each attribute has one Datatype.

The problem I am facing now is when I want to set the attribute datatype [in a model which is conforme to my metamodel ] in the Property View (Eclipse EMF), I get an empty list.

I want something similar to when adding an EAttribute , you get the choice between different Etype (EString, EBoolean,...).

I appreciate any help.

Thank you.


Solution

  • You can add EDataType instances on the same level as EClasses, and they can refer to any kind of Java object. However, be careful that only very simple serialization is available for these objects.