| [news.eclipse.tools.emf] Re: GenModel and file extension |
Cyril,
Comments below.
I'm not sure what to say. Models can use a number of different extensions and can even use different types of serialization. I could imagine generating a field like the eCONTENT_TYPE with the list of extensions specified in the GenModel, but that would require Java reflection to find....Comments below.
Ed Merks a écrit :Cyril,
Comments below.
Cyril Faucher wrote:Yes, this gives you explicit control over what file extension*s* will be used; you can specify several...Hi,
I am discovering a new (for me) parameter in the GenModel: file extension.
Firstly, this parameter has replaced prefix to calculate the file extension ?It's used in the model's plugin.xml; remember that plugin.xml doesn't regenerate. It's also used to register the editors and is needed in the wizard to make sure a good file extension is chosen. So again, it affects the plugin.xml and it affects the generated plugin.properties; the former of course doesn't regenerate, and the latter while supporting merging will not change the value of an existing property.
Where is it reused in the generated code by EMF: model, edit, editor ?I wish to get it throw the model source code. In my application, I have not access from the genmodel and the edit or editor plugins are not generated.I see.Hmmm. No. If you declare a content type, a constant for that is generated in the XyxFactory interface, and with content types, many different extensions could be supported at the same time, including extensions also used by other models...
So the question: is there a workaround for getting the file extension without the *.genmodel, edit and editor plugins, but only with the model plugins.
Are you writing a generic application or can you just declare a constant for your model that you use elsewhere?
I am writing a generic application with a generic loader and saver for EMF models.
I need the file extension, XyzPackageImpl class and the XyzResourceFactoryImpl class (If it exists) too.
I suppose you could paw through the configuration elements of their plugin to look for parser registrations...
My problem is that I am not able to assum the provider of a metamodel has deployed the genmodel or the editor plugin.
They're not actually used there though...
So my entry points for getting these informations are the plugin extensions: org.eclipse.emf.ecore.generated_package and org.eclipse.emf.ecore.extension_parser. I am getting these extensions thanks to the uri.
Currently mostly information about EMF persistence are in the model plugin, maybe the extensions could be moved in this plugin... in the plugin.properties or in a Java Class.
Cyril.