|
Re: Arrays and Constructors in Class Diagram [message #1692113 is a reply to message #1692040] |
Mon, 13 April 2015 10:21   |
Eclipse User |
|
|
|
Hi,
The Java Profile has stereotypes that convey Java-specific semantics:
* <<javaMethod>> has an 'isConstructor' attribute
* <<primitiveType>> has an 'implementationClass' attribute
For array types, you might just need to model them explicitly as
DataTypes of some kind. Perhaps the <<primitiveType>>
'implementationClass' attribute could let you specify the array
declaration, e.g., 'MyDataType[]' or even something like
'MyDataType[16][16]'.
Hopefully someone responsible for the Java component can chime in with
a better answer about array types ...
HTH,
Christian
On 2015-04-13 12:49:28 +0000, Karel Mous said:
> Am currently using Papyrus 1.0.2 with Eclipse Luna. Am currently
> attempting to create some Class Diagrams, using the Java Profile and
> Java primitive types.
> Would like to ask the following, since I have been unable to figure out
> how to do it:
>
> - How can I define a Constructor in a Class? Every operation I try to
> create will have a "void" return type if nothing is set.
>
> - How can I create a array in the Class. I know I can set the
> multiplicity of an attribute, but when generating code, the attribute
> comes out like this: "List<DataType> var". I would like it to be a real
> array, like this: "DataType[] var".
>
> Anybody have any idea how to do it, if it's possible?
|
|
|
|
Re: Arrays and Constructors in Class Diagram [message #1692389 is a reply to message #1692311] |
Wed, 15 April 2015 08:37  |
Eclipse User |
|
|
|
Hi, Karel,
Select your operation in the Model Explorer or a diagram. In the
Properties view, switch to the 'Profile' tab. There you have controls
for applying stereotypes to the operation and setting properties of
those stereotypes.
HTH,
Christian
On 2015-04-15 05:00:45 +0000, Karel Mous said:
> Hi Christian,
>
> Thanks for your reply.
>
> I've imported the Java Profile into the project via the Model Explorer
> and indeed notice that it contains a JavaMethod StereoType.
>
> How can I use this stereotype to make my "operation" a Java Method?
> Sorry I'm kinda new at the modeling tool, tried looking around the
> various menus but can't seem to find the correct solution to this
> problem.
>
> Hope you can help.
>
> Thanks in advance.
>
> Karel
|
|
|
Powered by
FUDForum. Page generated in 0.25082 seconds