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 16:35 Go to next message
--alex--  is currently offline --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() /*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 03:35 Go to previous message
--alex--  is currently offline --alex--
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: Thu Jul 24 06:57:01 EDT 2014

Powered by FUDForum. Page generated in 0.01467 seconds