2

I've this class diagram class diagram compose

and the multiplicity 1 : 0..*

The generated code from this model:

public class TestKlasseB {
    public TestKlasseB(){
    }
    ~TestKlasseB(){
    }
}//end TestKlasseB

public class TestKlasseA {
    public TestNameSpace.TestKlasseB m_TestKlasseB;    //this line
    public TestKlasseA(){
    }
    ~TestKlasseA(){
    }
}//end TestKlasseA

I would like the member variable in TestKlasseA as an array ( m_TestKlasseB )

public TestNameSpace.TestKlasseB[] m_TestKlasseB;

What I need to change?

--

Regards raiserle

PsiX
  • 1,661
  • 1
  • 17
  • 35
raiserle
  • 677
  • 8
  • 31

1 Answers1

2

You have two ways to do that.

Either you define your association as an attribute (member variable) and got to its detail properties and select Attribute is a Collection with [] as type.

Attribute as Collection

Or you go to source code engineering options and add a default collection class (e.g. List<#TYPE#> ) there under your language (Ctrl + F9, Source code Engineering -> Java -> Default Collection Class). Default Collection class

PsiX
  • 1,661
  • 1
  • 17
  • 35