Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » How to set opposite in association properties
How to set opposite in association properties [message #666666] Thu, 21 April 2011 09:50 Go to next message
ueli.brawand is currently offline ueli.brawand
Messages: 27
Registered: July 2009
Location: Berne, Switzerland
Junior Member
Hi all

How can I set the opposite (setOpposite()) of a Property programmaticaly?

When I try call prop.setOpposite(p2) then I get an IllegalStateException.

Any hints?

Thank you.
Ueli
Re: How to set opposite in association properties [message #666680 is a reply to message #666666] Thu, 21 April 2011 10:36 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 4026
Registered: July 2009
Senior Member
Hi

The debugger is always strongly recommended for debugging exceptions.

You will find that

public static void setOpposite(Property property, Property
newOpposite) {

if (property.getOwningAssociation() != null) {
throw new IllegalStateException();
}

indicating that opposites can only be set in the context of a valid
association.

Regards

Ed Willink


On 21/04/2011 14:50, Ueli Brawand wrote:
> Hi all
>
> How can I set the opposite (setOpposite()) of a Property programmaticaly?
>
> When I try call prop.setOpposite(p2) then I get an IllegalStateException.
>
> Any hints?
>
> Thank you.
> Ueli
Previous Topic:Diagram Question
Next Topic:Installing Eclipse & UML2 software
Goto Forum:
  


Current Time: Fri Aug 22 02:11:05 EDT 2014

Powered by FUDForum. Page generated in 0.02167 seconds