Getting stereotype's property values. [message #476913] |
Thu, 07 February 2008 13:36 |
Eclipse User |
|
|
|
Originally posted by: antti.evesti.vtt.fi
Hi
I have connected a stereotype for a component element. Now I try to get
properties and their values from that stereotype, how I should do this?
Following code gives properties' names correctly, but I cannot find a way to
getting values for these properties. I suppose this is quite trivial task.
However, I cannot find a suitable method for this task.
Thanks,
Antti
<------------------ CODE ----------------------------------->
private void getStereotypes(Component component) {
System.out.println("** Getting stereotypes for " +
component.getLabel());
EList<Stereotype> e = component.getAppliedStereotypes();
for(Stereotype s : e) {
System.out.println(s.getLabel());
EList<Property> el = s.getAttributes();
for(Property p : el) {
System.out.println(p.getLabel());
}
}
}
}
|
|
|
|
Re: Getting stereotype's property values. [message #476916 is a reply to message #476915] |
Fri, 08 February 2008 06:41 |
Eclipse User |
|
|
|
Originally posted by: antti.evesti.vtt.fi
Thanks James!
Article gives an idea, that what I made wrong.
I called property.getValue(stereotype, property.getName()), instead of
component.getValue(stereotype, property.getName()).
BR,
Antti
"James Bruck" <jbruck@ca.ibm.com> wrote in message
news:fof5c5$ge8$2@build.eclipse.org...
> Hi Antti,
>
> Have a look at:
> http://www.eclipse.org/modeling/mdt/uml2/docs/articles/Intro duction_to_UML2_Profiles/article.html
>
> Cheers,
> - James
>
> "Antti Evesti" <antti.evesti@vtt.fi> wrote in message
> news:fof1gu$f31$1@build.eclipse.org...
>> Hi
>>
>> I have connected a stereotype for a component element. Now I try to get
>> properties and their values from that stereotype, how I should do this?
>> Following code gives properties' names correctly, but I cannot find a way
>> to getting values for these properties. I suppose this is quite trivial
>> task. However, I cannot find a suitable method for this task.
>>
>> Thanks,
>> Antti
>>
>> <------------------ CODE ----------------------------------->
>> private void getStereotypes(Component component) {
>>
>> System.out.println("** Getting stereotypes for " +
>> component.getLabel());
>>
>>
>> EList<Stereotype> e = component.getAppliedStereotypes();
>>
>> for(Stereotype s : e) {
>>
>> System.out.println(s.getLabel());
>>
>> EList<Property> el = s.getAttributes();
>>
>> for(Property p : el) {
>>
>> System.out.println(p.getLabel());
>>
>> }
>>
>> }
>>
>>
>>
>> }
>>
>> }
>>
>>
>
>
|
|
|
|
Re: Getting stereotype's property values. [message #625994 is a reply to message #476915] |
Fri, 08 February 2008 06:41 |
Eclipse User |
|
|
|
Originally posted by: antti.evesti.vtt.fi
Thanks James!
Article gives an idea, that what I made wrong.
I called property.getValue(stereotype, property.getName()), instead of
component.getValue(stereotype, property.getName()).
BR,
Antti
"James Bruck" <jbruck@ca.ibm.com> wrote in message
news:fof5c5$ge8$2@build.eclipse.org...
> Hi Antti,
>
> Have a look at:
> http://www.eclipse.org/modeling/mdt/uml2/docs/articles/Intro duction_to_UML2_Profiles/article.html
>
> Cheers,
> - James
>
> "Antti Evesti" <antti.evesti@vtt.fi> wrote in message
> news:fof1gu$f31$1@build.eclipse.org...
>> Hi
>>
>> I have connected a stereotype for a component element. Now I try to get
>> properties and their values from that stereotype, how I should do this?
>> Following code gives properties' names correctly, but I cannot find a way
>> to getting values for these properties. I suppose this is quite trivial
>> task. However, I cannot find a suitable method for this task.
>>
>> Thanks,
>> Antti
>>
>> <------------------ CODE ----------------------------------->
>> private void getStereotypes(Component component) {
>>
>> System.out.println("** Getting stereotypes for " +
>> component.getLabel());
>>
>>
>> EList<Stereotype> e = component.getAppliedStereotypes();
>>
>> for(Stereotype s : e) {
>>
>> System.out.println(s.getLabel());
>>
>> EList<Property> el = s.getAttributes();
>>
>> for(Property p : el) {
>>
>> System.out.println(p.getLabel());
>>
>> }
>>
>> }
>>
>>
>>
>> }
>>
>> }
>>
>>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03055 seconds