Hi Martin,

you work with AndroMDA 2.x, right? The problem in your
getAttributesByStereotype() method is: the return value type is wrong.
You have to return a collection of PAttribute, not of Attribute. This
will help because in Attribute, there is no method called
getTaggedValues(). velocity.log should have told you that.

BTW, in AndroMDA 3.x, you will have to return AttributeFacade instead of
PAttribute.

Cheers...
Matthias

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf 
> Of MArtin Schumacher
> Sent: Wednesday, February 11, 2004 5:52 PM
> To: [EMAIL PROTECTED]
> Subject: [Andromda-user] method in SimpleOOHelper returns 
> "wrong" Attributes
> 
> 
> Hi everyone,
> 
> i changed the SimpleOOHelper and created a method
> "getAttributesByStereotype" (see below @ [1]).  It gets an String (the
> Stereotype) and a class-object.
> Now i use it this way:
> ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< -----
> #foreach ( $att in $transform.getAttributesByStereotype("PrimaryKey",
> $source) )
> #set ($dbcolumn = $transform.findTagValue($att.taggedValues, 
> "db.column") )
> ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< -----
> I can't read the TaggedValues of $att. :(
> 
> If I use
> ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< -----
> #foreach ( $att in $source.attributes )
> #set ($dbcolumn = $transform.findTagValue($att.taggedValues, 
> "db.column") )
> ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< -----
> it works fine...
> 
> Does anyone has a hint for me, why this can happen? Where do 
> I loose my
> TaggedValues?
> 
> Thx for your help,
> 
> MArtin
> 
> [1]
> ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< -----
> public java.util.Collection getAttributesByStereotype(String 
> stereotype,
> Object object)
> {
>   java.util.ArrayList al = new java.util.ArrayList();
>   for (Iterator it = getAttributes(object).iterator(); it.hasNext();)
>   {
>     Attribute a = (Attribute) it.next();
>     // check if attribute is the PK of this class
>     if (getStereotypeNames(a).contains(stereotype))
>     {
>       al.add(a);
>     }
>   }
>   return al;
> }
> ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< -----
> 
> -- 
> have a look @ http://www.auchich.de
> 
> 
> 
> 
> -------------------------------------------------------
> SF.Net is sponsored by: Speed Start Your Linux Apps Now.
> Build and deploy apps & Web services for Linux with
> a free DVD software kit from IBM. Click Now!
> http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
> _______________________________________________
> Andromda-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/andromda-user
> 




-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Andromda-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/andromda-user

Reply via email to