| [news.eclipse.tools.emf] Re: Serialization: additional date formats |
|
Jason, Your wish is my demand! Err, I mean command. Here's an example of an EOperation expressed in XML Schema using appinfo. <xsd:complexType ecore:implements="sdo:DataObject" name="EDataObject"> <xsd:annotation> <xsd:appinfo ecore:key="operations" source="http://www.eclipse.org/emf/2002/Ecore"> <operation name="getInstanceProperties" type="sdo:EJavaList{sdo:Property}"> <body>return <%org.eclipse.emf.ecore.sdo.util.SDOUtil%>.getInstanceProperties(this);</body> </operation> </xsd:appinfo> </xsd:annotation> </xsd:complexType> You can generate your own example by using Generator->Export Model...->XML Schema from a GenModel for an Ecore model that has an EOperation with a body EAnnotation. Note that <%a.b.C%> (with escaped < and >) is the way to express something that should be imported as it's being generation. jason henriksen wrote: Another possible approach, depending on how you've defined your model, is to suppress the XGC accessors from the API, but leave them in the Impl as is. Then define EOperation (you'd have to pick a different name that doesn't collide) to get and set the Joda thing and to delegate through the XGC methods in the impl; you can do this feature a body annotation that lets you specify the Java snippet right on the operation definition. This way everything you'd need could be specified right in your model and it would produce working code right out of the box... |