|How to create programatically un object of given DataType [message #1073721]
||Thu, 25 July 2013 11:22
| hongyu liu
Registered: March 2012
Given a UML self-defined DataType, not UML pre-defined DataType (e.g. MyType), how to create its instance programatically?
In a UML profile, we define a stereotype which has some attributes of MyType. In order to specify a UML model correctly, we need to create an instance of MyType after we apply the stereotype.
Example Pseudo Code:
Stereotype st = getStereotypeByName("name");
DataType dt = getDataTypeByName("MyType");
EObject instance = createInstance(dt);
target.setValue(st, "myTypeAttr", instance);
How this method "EObject createInstance(DataType dt)" can be implemented ?
Thanks in advance.
Powered by FUDForum
. Page generated in 0.01510 seconds