How do I create an EAttribute whose data type is not an EMF class?

后端 未结 3 2132
名媛妹妹
名媛妹妹 2021-02-09 02:38

Using EMF, I\'d like to define an attribute whose data type (EType) is external to my EMF model. That is, the type I want is a normal hand-coded Java class that is not part of m

3条回答
  •  轮回少年
    2021-02-09 03:10

    Assuming you're using Xcore as your modelling language, then use

    import java.util.Date
    ...
    type Date wraps Date
    

    Now Date can be used as a data type for attributes in line with String and int.

    You do the same with Ecore, except that you don't have to explicitly import the type first - e.g.

    
    

提交回复
热议问题