|PrimitiveType [message #907997]
||Tue, 04 September 2012 10:20
| Florian Wartenberg
Registered: July 2012
Hi I want to create a new property inside a class which has the type Integer. I use this construct: modelClass.createOwnedAttribute(String arg0, Type arg1, EClass arg2).|
Can anyone post an example how to create a property with this construct I cant resolve type.
|Re: PrimitiveType [message #908767 is a reply to message #908642]
||Wed, 05 September 2012 21:01
| Christian W. Damus
Registered: July 2009
If you have other classes in your model that have properties that
reference Integer as their type, then where did they get it from?
Probably it is the Integer in the UML Primitive Types library. The URI
for the library resource is
You would see it already loaded in the editor if you open your model in
the UML Editor.
Anyways, given that you already have properties of Integer type, you
should be able to find the library resource (URI as above) loaded in
your resource set. The first element in the resource is a package on
which you can use the getOwnedType(…) method that you mentioned
earlier, to get the Integer type.
On 2012-09-05 18:05:40 +0000, Florian Wartenberg said:
> Ok I have a .uml file which I load then I do some transformations on
> the model. At some point I have to create a new property inside my main
> class. Therefore I use the line written above. My property is created
> but has no type. I want to have a property which has the type
> "<PrimitveType> Integer" which several other properties of the model
> already have. The second argument of the method is "Type" I do not know
> what Java or EMF is expecting me to resolve it to so I get the Integer
> type. If I for example resolve the second argument to my class
> ("modelClass") then the property is created whith a type and the type
> is <Class> ECU which is the name of my class inside the model.
> regards Florian
Powered by FUDForum
. Page generated in 0.05658 seconds