Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community Forums[Ecore] deep copying properties of Ecore elements without subcontents
https://www.eclipse.org/forums/index.php/mv/msg/206248/660277/#msg_660277
I'm using a TreeIterator to process model elements one at a time. If an element (EPackage, EClass, EAttribute or EReference) should be a part of the resulting model, I create a new appropriate Ecore class and then I need to set all the properties as in the original element. However, I do not want to set references such as subpackages, since at the moment that I'm processing this package I don't know which of it's subpackages will fulfill the processing conditions to be taken into the resulting model. So,
I just tried using EcoreUtil.copy and EcoreUtil.Copier.copy but they both have the effect of copying everything the package contains, which I don't want - I need the package alone, cut off from it's super and subpackages...
Is there a way to this other than stripping the copied package contents manually?]]>leonard.krpan2011-03-17T16:15:09-00:00Re: [Ecore] deep copying properties of Ecore elements without subcontents
https://www.eclipse.org/forums/index.php/mv/msg/206248/660291/#msg_660291
references.
lk_muc wrote:
> I'm processing an Ecore model where the resulting model is a subset of
> the original one, but should be an independet model without any
> references to the original one.
>
> I'm using a TreeIterator to process model elements one at a time. If
> an element (EPackage, EClass, EAttribute or EReference) should be a
> part of the resulting model, I create a new appropriate Ecore class
> and then I need to set all the properties as in the original element.
> However, I do not want to set references such as subpackages, since at
> the moment that I'm processing this package I don't know which of it's
> subpackages will fulfill the processing conditions to be taken into
> the resulting model. So,
> I just tried using EcoreUtil.copy and EcoreUtil.Copier.copy but they
> both have the effect of copying everything the package contains, which
> I don't want - I need the package alone, cut off from it's super and
> subpackages...
>
> Is there a way to this other than stripping the copied package
> contents manually?]]>Ed Merks2011-03-17T16:37:46-00:00