[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [uml2-dev] apply stereotype to an attribute
|
Laco,
Please post questions like this to the
eclipse.tools.newsgroup.
Thanks,
Kenn Hussey
Senior Software Developer
Rational Software, IBM Software Group
770 Palladium Drive
Kanata, Ontario, K2V 1C8
T: (613) 599-3980 F: (613) 599-3912
"el dzi" <eldzino@xxxxxxxxx>
Sent by: uml2-dev-bounces@xxxxxxxxxxx
09/29/2006 12:49 PM
Please respond to
"This mailing list is used to discuss the development issues for the
UML2 project. " <uml2-dev@xxxxxxxxxxx> |
|
To
| uml2-dev@xxxxxxxxxxx
|
cc
|
|
Subject
| [uml2-dev] apply stereotype to an attribute |
|
Hello there,
I have following problem with applying UML2 profile stereotype to an
attribute. I defined database profile (attached in mail). There is
stereotype PrimaryKey which I want to assign to my model's attribute
programmatically.
I loaded profile to a variable, created model, applied the profile.
Then I started filling the model with classes and their attributes.
After creating a class and assigning attributes I wanted to apply
PrimaryKey stereotype to that attribute following example in
documentation. It throws exception
java.lang.IllegalArgumentException:
org.eclipse.uml2.uml.internal.impl.StereotypeImpl@b9b538 (name:
PrimaryKey, visibility: <unset>) (isLeaf: false, visibility: public,
isAbstract: false) (isActive: false, isAbstract: false)
I debugged my code and UML2 code and found that in class
ElementOperations in method getExtension an EClassifier is retrieved
through getClassifier method. Input to the getClassifier method is a
ClassImpl. Its toString method returns this (from debugger):
org.eclipse.uml2.uml.internal.impl.ClassImpl@626fd2 (eProxyURI:
pathmap://UML_METAMODELS/UML.metamodel.uml#Property)
getClassifier returns null because this ClassImpl doesn't have name
field defined.
I tried to apply this stereotype through applyStereotype method of
Property element (attribute) which is assigned to class and it is
assigned to package and the package is assigned to the model.
Can you tell me how can I apply stereotype defined in profile file in
model in memory? Am I something missing?
Thanks in advance.
Laco.
_______________________________________________
uml2-dev mailing list
uml2-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/uml2-dev
Attachment:
database.profile.uml
Description: Binary data