|Re: [mmt-dev] EmfUtil: content-type computation|
HiThere are many things about EMF resources that are not dealt with perfectly, particularly in standalone contexts and so many 'helpful' contributions exist that bypass the true problems.
EmfUtil.createResource(uri,outResourceSet) appears to try to be help by providing some rescue heuristics in case resourceSet.createResource(URI) returns null.
Rather than rescue heuristics it is better to tackle the original problem, which as discussed on the EMF thread is to use an EPackage to content-type mapping to enable createResource(URI, content-type) to create an EPackage-relevant resource.
The deduction of an EPackage from an outResourceSet is not necessarily trivial so the lack of content-type support is probably earlier where the meta-model EPackage is known.
Regards Ed Willink On 18/06/2012 08:32, Uwe Ritzmann wrote:
Gentlemen, I do have a problem with a custom ResourceFactory implementation that I registered as content-parser and is not found for resource creation on an QVTo output model. Details are given here: http://www.eclipse.org/forums/index.php/t/362084/ I wonder whether org.eclipse.m2m.internal.qvt.oml.emf.util.EmfUtil.createResource(uri,outResourceSet) is up to date with the current EMF ResourceSetImpl implementation. I think the additional usage of the extension-to-factory map is handled by ResourceSetImpl already and think that the whole method could be inline replaced by outResourceSet.createResource(uri,UNSPECIFIED_CONTENT_TYPE); Did I overlook something? Best Regards Uwe
Back to the top