Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 GMF(图形建模框架)中有一个名为File和另一个名为的类。Folder在类定义中,Folder有一个返回的方法List<File>,那么我如何在我的 ecore 模型中定义呢?
File
Folder
List<File>
您需要在文件夹类上创建一个包含引用。引用将是一对多,引用类型应为文件
假设已经创建了 EClasses 文件夹和文件。右键单击文件夹 EClass "New Child" -> "EReference" 选择 EReference 并为其打开属性视图 现在,在选择 EReference 时,在属性视图中执行以下操作:
就是这个。生成的文件夹类将具有文件功能的 getter 和 setter。