Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Referencing and referenced EObject
Referencing and referenced EObject [message #431290] Tue, 07 July 2009 16:40 Go to next message
lancel lau is currently offline lancel lauFriend
Messages: 31
Registered: July 2009
Member
Hi,

I can use the method eCrossReferences() to get the referencing EObjects of
a EObject, but if i want to get the referenced EObject, what should i do?

regards
Re: Referencing and referenced EObject [message #431291 is a reply to message #431290] Tue, 07 July 2009 16:52 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
lancel lau schrieb:
> Hi,
>
> I can use the method eCrossReferences() to get the referencing
> EObjects of a EObject, but if i want to get the referenced EObject,
> what should i do?
eCrossReferences() is not what you think it to be. It's what you're
looking for ;-)

An object can have two sorts of references to other objects: containment
references and cross references. eCrossReferences() returns, guess, the
latter.

You might be interested in
org.eclipse.emf.ecore.util.EcoreUtil.UsageCrossReferencer, though.

Cheers
/Eike

----
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: Referencing and referenced EObject [message #431292 is a reply to message #431290] Tue, 07 July 2009 16:54 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Lancel,

Comments below.

lancel lau wrote:
> Hi,
>
> I can use the method eCrossReferences() to get the referencing
> EObjects of a EObject,
It returns all the objects referenced by non-container/containment
references the given EObject.
> but if i want to get the referenced EObject, what should i do?
If you want to find all references to an EObject you need to use
something like a EcoreUtil.UsageCrossReferencer or ECrossReferenceAdapter.
>
> regards
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[EMF Databinding] How to specify additional triggers for the update of a binding?
Next Topic:[Teneo][EMF][BIRT] Is it possible to create Reports with a Teneo Datasource?
Goto Forum:
  


Current Time: Thu Mar 28 10:42:33 GMT 2024

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

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

Back to the top