Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » [Solved]Strange behaviour with getAppliedStereoTypes(), getAppliedStereoType
[Solved]Strange behaviour with getAppliedStereoTypes(), getAppliedStereoType [message #503902] Wed, 16 December 2009 10:30 Go to next message
Stefan  is currently offline Stefan Friend
Messages: 13
Registered: October 2009
Junior Member
Hi,

i am currently working on an M2M transformation for an UML Model. Starting with a Model with two profiles applied. I have the following problem. While iterating over all packages embedded in the model i am trying to get the applied profiles for each package. if i do this:
Stereotype st : pack.getAppliedStereotypes()

I get back all the applied Stereotypes and everything is fine. But then i try to get a single StereoType by name, i always get back null. Even if i do something like this
for (Stereotype st : pack.getAppliedStereotypes()){
   String name = st.getName();
   Stereotype stereo = pack.getAppliedStereotype(name);

I dont understand why, i get all the applied stereotypes, iterating over them getting the name of each and the try to get it by name and it returns null.

Any advice?

Stefan

Ok i am just to foolish to use the right method (getQualifiedName()). thx for ignoring neverless.

Laughing Stefan

[Updated on: Wed, 16 December 2009 05:51]

Report message to a moderator

Re: Strange behaviour with getAppliedStereoTypes(), getAppliedStereoType [message #504009 is a reply to message #503902] Wed, 16 December 2009 19:43 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Stefan,

You mention that " in the model i am trying to get the applied profiles "
but your code is trying to get applied stereotypes.
Could the problem be that you are trying to get sterotypes when you mean
profiles or vice versa?

- James.

"Stefan" <schegi@uni-koblenz.de> wrote in message
news:hgacrk$10j$1@build.eclipse.org...
> Hi,
>
> i am currently working on an M2M transformation for an UML Model. Starting
> with a Model with two profiles applied. I have the following problem.
> While iterating over all packages embedded in the model i am trying to get
> the applied profiles for each package. if i do this:
> Stereotype st : pack.getAppliedStereotypes()
>
> I get back all the applied Stereotypes and everything is fine. But then i
> try to get a single StereoType by name, i always get back null. Even if i
> do something like this
>
> for (Stereotype st : pack.getAppliedStereotypes()){
> String name = st.getName();
> Stereotype stereo = pack.getAppliedStereotype(name);
>
> I dont understand why, i get all the applied stereotypes, iterating over
> them getting the name of each and the try to get it by name and it returns
> null.
>
> Any advice?
>
> Stefan
>
Previous Topic:Tag value element looses owner
Next Topic:Class.getExtensions()?
Goto Forum:
  


Current Time: Mon Dec 22 13:29:19 GMT 2014

Powered by FUDForum. Page generated in 0.01947 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software