【发布时间】:2017-05-17 13:48:45
【问题描述】:
如何以编程方式将 EGeneric 类型参数添加到 EAttribute?
我可以像这样创建一个 EAttribute:
EAttribute eAttribute = EcoreFactory.eINSTANCE.createEAttribute();
eAttribute.setName("myAttribute");
EDataType dataType = EcorePackage.eINSTANCE.getEEList();
// add here String to List as generic argument?
eAttribute.setEType(dataType);
但是使用该代码 sn-p 没有指定 EEList 的泛型类型参数。在 Eclipse 中,我将使用 New Child > EGeneric Type Argument 修复它,然后将 EGeneric 类型参数的 EClassifier 设置为 EString。但我怎样才能以编程方式做到这一点?
【问题讨论】:
标签: java eclipse-emf emf eclipse-emf-ecore