test an integer property [message #491974] |
Fri, 16 October 2009 20:35 |
--alex-- Messages: 26 Registered: October 2009 |
Junior Member |
|
|
Hi all,
I've problems in getting the value of a property of an element. The property has type PrimitiveType (actually PrimitiveTypeImpl) which has "integer" as its name.
I wrote the code to access that property but I can't find a way to get its value. I tried "getValue(stereotype, propertyName)" but no stereotype I have makes the call successful. I have tried everything I've found in the UML API with no success.
I know the following code drives me in the right direction as I traced in the eclipse debug.
Here is my code:
...
Element objectselected = (Element) sel.getFirstElement();
for (Stereotype strt : objectselected.getAppliedStereotypes()) {
if (!strt.getOwnedRules().isEmpty()) {
if (strt.getName().equals("RequiredOperation")) {
for (Property p : strt.getOwnedAttributes()) {
if (p.getName().equals("invocations")) {
if (p.GETVALUE()>0 /*test non-negativity of the integer value of invocations*/) {
}
}
....
what can I write to replace GETVALUE()?
[Updated on: Fri, 16 October 2009 20:37] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03251 seconds