Book a Demo

Author Topic: Get Stereotype of the Class of an attribute  (Read 3125 times)

SammyC

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Get Stereotype of the Class of an attribute
« on: August 09, 2006, 05:02:57 am »
Hello,

I trying to use the Code Generation templates to auto generate my code for me. However, I seem to have hit upon a problem :(.

What I want to do is to determine the stereotype of the class of an attribute. For example:

Class A
{
  MyType x;

...
};

When I'm generating the code for the 'x' attribute of class A I want to know what the stereotype of MyType is.
If I use the stereotype overrides or attStereotype macros they look at the stereotype of the attibute 'x' not of the class MyType. :(

Any ideas how this can be achieved?

Sam.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Get Stereotype of the Class of an attribute
« Reply #1 on: August 09, 2006, 02:53:09 pm »
This isn't available directly from the templates, but you can get it using a call to an addin.

Use EXEC_ADD_IN to call a function in your addin to look up the stereotype of the classifier of the attribute.  There are quite a few examples of how to use this posted to the forum if you do a search.

SammyC

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Get Stereotype of the Class of an attribute
« Reply #2 on: August 10, 2006, 01:18:51 am »
Would I have to write this AddIn myself or is there one already I can use?

I don't have access to any development environment such as VB or VC as I as am developing for Java.

thomaskilian

  • Guest
Re: Get Stereotype of the Class of an attribute
« Reply #3 on: August 10, 2006, 02:35:17 pm »
You can also use Perl. Probably bad taste for a C*-guy, but it's free and works under almost every environment.