|Re: Attaching EObject instance to serialized object [message #478796 is a reply to message #478720]
||Fri, 07 August 2009 00:00
| Ed Merks
Registered: July 2009
Bryan Banz wrote:
> I'm not sure I described my situation clearly enough. Correct me if
> I'm wrong, but wont getEObject() just create a new instance of an
> object from the resource containing it?
It returns the object contained by the resource.
> What I have is a modeled object that I'm trying to treat as a
> singleton. On that object I have a method that is sort of a "load from
> file" in which a URI is passed.
That's what resource sets normally do. I'm not sure I understand how or
why a singleton is doing what you describe.
> So I already have an existing object and I'd like to fill out all its
> attributes and references so that it "becomes" the object that was
> persisted to the resource.
That's what proxies are normally used for.
> I know (I don't think) this would work, but perhaps it would get
> across what I'm trying to do:
> EObject object = resource.getContents().get(0);
> this = (MyObjectType)object;
No matter what you're trying to do, loading a resource into a resource
and getting the object from that resource is the way "load from file" is
Professional Support: https://www.macromodeling.com/
Powered by FUDForum
. Page generated in 0.02493 seconds