|
|
|
Re: generated EReference defaulting to changeable="false" [message #415106 is a reply to message #415105] |
Thu, 29 November 2007 21:17 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Ted,
I'm actually working on a new serialization feature that will deduce
substitution group elements during save. This way you can have your
syntactic sugar without the associated dose of rat poison in the API.
I'll open a bugzilla soon and describe the new support; maybe I'll have
time to write a blog again.
Note that there is a GenPackage property "Literals" that controls
whether the Literals interface is generated. For large models this
interface can exceed Java's byte code limits so the property defaults to
false in that case.
Ted Bashor wrote:
> A belated thanks to Ed for the help, and thanks too for the colorful
> metaphor - I enjoyed telling people substitution groups are semantic
> rat poison :-)
>
> A tip for EMF 2.3 newbies: looks like there's been some code change,
> cause there doesn't seem to be a Literals in the generated Package,
> plus FeatureMap.add(int, E) method wants a typed FeatureMap.Entry for
> the second parameter.
>
> You could do what Ed suggested a few different ways, but the following
> worked for me.
>
> FeatureMap map = container.getAbstractElementGroup();
> map.add(XYZPackage.eINSTANCE.getDocumentRoot_ConcreteElement (),
> concreteElement);
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03234 seconds