Problem with namespaces [message #890000] |
Wed, 20 June 2012 10:16  |
Eclipse User |
|
|
|
Hi there,
I want to read the xmi:id s of objects in my model. In case such an object does not have an attribute or reference called id, everything works fine by use of this code:
aui!`InterfaceType`.allInstances().first().`id`.println();
But if there is an Object which defines an id-attribute in its own namespace, I cannot read the xmi:id:
aui!`GroupingType`.allInstances().first().`id`.println();
So the first statement resolves to: "_9oArcHgFEeGEQaFIIY_fFA"
and the second to: "Visualisierung"
I use this model:
<InterfaceType ... xmi:id="_9oArcHgFEeGEQaFIIY_fFA" ...>
...
<grouping xmi:id="_EGHXUHgGEeGEQaFIIY_fFA" id="Visualisierung">
...
Is there any way to choose an attribute from a specific namespace?
Thanks in advance.
Lukas
|
|
|
|
|
|
Re: Problem with namespaces [message #892894 is a reply to message #891233] |
Sun, 01 July 2012 11:03   |
Eclipse User |
|
|
|
Hi Dimitris,
this already helped me alot, but I have one problem, I cannot solve.
By use of the structural features, I can get properties of an object, by use of the property name as a string.
This is the code.
property = object.eClass().dynamicGet(sf.featureId);
This often works, but if a certain property is marked as derived (or volatile) this method does not work, property won't be defined.
How can I get the value of such a derived feature?
Greetings
Lukas
[update]
It turns out, that nothing changes when I set markers derived, volatile, transient in the ecore-model to false.
Where can be the difference between my method above to access the property and the method, which is used in epsilon?
Just before someone asks. The property, I try to read is definitely existent in the model.
[Updated on: Sun, 01 July 2012 11:31] by Moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.04157 seconds