Book a Demo

Author Topic: Marker for qualifier type in qualifier collections  (Read 2881 times)

Matija Lukic

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Marker for qualifier type in qualifier collections
« on: January 30, 2013, 09:48:38 pm »
Hello,

I'm using EA 8 and I'm currently tweaking with code generation templates for my company's needs. In particular, we want to generate getters and setters for collections (ie. elements of the collections, put/get methods).

I've read here: http://www.sparxsystems.com/enterprise_architect_user_guide/software_development/settingcollectionclasses.html that I can use the <#TYPE#> marker to refer to "Class being collected at source generation time (for example, Vector<#TYPE#> would become Vector<foo>)."

Is there a way to refer to the type of the qualifier in the qualified collections?

For example, if Class1 has an association towards Class2, the role of the target (Class2) is "items" and the qualifier is "key: String"

I'd expect that something like:

Map<#QUALIFIER_TYPE#, #TYPE#> would in the end produce

Class1 {
  Map<String, Class2> items;
}

thanks,
Matija