Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » test an integer property
test an integer property [message #627997] Fri, 16 October 2009 20:35 Go to next message
--alex--  is currently offline --alex-- Friend
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() /*test non-negativity of the integer value of invocations*/) {
}
}
....

what can I write to replace GETVALUE()?
Re: test an integer property [message #627998 is a reply to message #627997] Mon, 19 October 2009 07:35 Go to previous message
--alex--  is currently offline --alex-- Friend
Messages: 26
Registered: October 2009
Junior Member
Ok, I solved my problem using getvalue() at the element level, not at the property level!

Sorry for the question, it's just I've to get used to this uml framework!
Previous Topic:test an integer property
Next Topic:Loading programatically a model referring to a profile in a standalone application
Goto Forum:
  


Current Time: Fri Apr 26 12:36:50 GMT 2024

Powered by FUDForum. Page generated in 0.03145 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top