Reputation: 615
Begin relative new to EMF I can only give sketch of what I want to do. The end product is a eclipse plug-in that have access to at least two EMF models. The first model is created by using Xtext to defined DSL. The second EMF is created using xtend code based on a ecore model.
My questions:
How to create an EMF instance of the ecore model using java/xtend when the code is executed in the plug in. The code snippets I find look like
val resourceSet = new ResourceSetImpl val resource = resourceSet.getResource(URI.createURI(file), true)
but have no idea what the value of file
must be to reference the ecore model.
Upvotes: 0
Views: 203
Reputation: 862
If I understand correctly, what you want to have is a model in your plug-in that's deployed in your end product. In that case you probably want to look at "platform:/plugin/..." URIs which you can probably use to retrieve artefacts from the running platform.
See URI.createURI(String) although you may want to look at URI.createPlatformPluginURI in your case
Search for Model-to-Model transformations, which you can specify with a variety of technologies (including Java, Xtend, ATL, etc.)
Upvotes: 2