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.

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top