1
如何以編程方式將一個EGeneric類型參數添加到EAttribute
? 我可以這樣創建EAttribute:如何以編程方式向EAttribute添加EGeneric類型參數?
EAttribute eAttribute = EcoreFactory.eINSTANCE.createEAttribute();
eAttribute.setName("myAttribute");
EDataType dataType = EcorePackage.eINSTANCE.getEEList();
// add here String to List as generic argument?
eAttribute.setEType(dataType);
但隨着該代碼段沒有指定EEList
的泛型類型參數。在Eclipse中,我將使用New Child > EGeneric Type Argument
修復該問題,然後將EGeneric Type Argument的EClassifier
設置爲EString
。但我怎樣才能以編程的方式做到這一點?