Author Topic: Outer Class ?  (Read 3952 times)

meierch

  • EA User
  • **
  • Posts: 35
  • Karma: +0/-0
  • Modeling we can!
    • View Profile
Outer Class ?
« on: February 07, 2010, 02:58:40 am »
I try to generate some statements in the dot language used by GraphViz. I have a bunch of nested classes (classes with inner classes) - in other words a tree.

A
    B
    C

I need to transform this to

A -> B
A -> C

I have seen that I can check if a class is nested with %classIsNested%. But I don't know how to get the name of the outer class.

Any suggestion how to do this?

Thanks
Christian
Regards
Christian

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: Outer Class ?
« Reply #1 on: February 08, 2010, 08:57:20 pm »
Hi,

From http://www.sparxsystems.com/uml_tool_guide/sdk_for_enterprise_architect/fieldsubstitutionmacros.html
Quote
classQualNameThe Class name prefixed by its outer Classes. Class names are separated by double colons ( :: ).

May be you could use this, to do the trick?

HTH
Günther

meierch

  • EA User
  • **
  • Posts: 35
  • Karma: +0/-0
  • Modeling we can!
    • View Profile
Re: Outer Class ?
« Reply #2 on: February 09, 2010, 05:19:05 am »
Thanks ... I was also trying this. But how do I find the second occurance of '::' from the end?

Christian
Regards
Christian

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: Outer Class ?
« Reply #3 on: February 10, 2010, 01:57:04 am »
Hmm,
I see, to get the outer classes' bare class name (without namespace prefixes) s.th. like a find-from-end() macro would be needed (replace() to eliminate your actual classes' name + prefixed '::', finding and cutting aftwerwards) ; or that looping would need to be supported in the code generation templates.
I was missing fully fledged program control flow features in the code generation template language several times already :-( ...

WBR
Günther

meierch

  • EA User
  • **
  • Posts: 35
  • Karma: +0/-0
  • Modeling we can!
    • View Profile
Re: Outer Class ?
« Reply #4 on: February 10, 2010, 06:09:06 am »
Another idea was to pass the name of the outerclass as a template parameter when the inner classes are processed. But does alos not work ...
Regards
Christian