[QVTo] UnitResolverFactory weiredness [message #856161] |
Wed, 25 April 2012 12:22 |
Eclipse User |
|
|
|
Hello,
when using QVTo transformations programmatically, the method
InternalTransformationExecutor.doLoad() executes this code:
UnitProxy unit = UnitResolverFactory.Registry.INSTANCE.getUnit(fURI);
if (unit == null) {
/* ... cause error and return */
}
So obviously a UnitResolverFactory must be there which handles the input
URI (specifying the *.qvto script). However, the default
UnitResolverFactory which is present is the EclipseUnitResolverFactory,
does not accept my URI.
What I did now is I wrote my own
public class MyUnitResolverFactory implements UnitResolverFactory...
and registered it at the org.eclipse.m2m.qvt.oml.unitResolverFactory
extension point. However, while that works, I'm extending a private
interface so it's a bit shady.
What is the recommended way for this to "just work", be it in a runtime
workbench or not? The same question was asked here, but was never
answered: http://www.eclipse.org/forums/index.php/t/238973/
Thanks
Marius
|
|
|
Re: [QVTo] UnitResolverFactory weiredness [message #856178 is a reply to message #856161] |
Wed, 25 April 2012 12:44 |
Ed Willink Messages: 7679 Registered: July 2009 |
Senior Member |
|
|
Hi
You haven't provided your URI so it is difficult to tell whether
your URI is bad
the QVTo code is bad
the QVTo interface should be public
Regards
Ed Willink
On 25/04/2012 13:22, Marius Gröger wrote:
> Hello,
>
> when using QVTo transformations programmatically, the method
> InternalTransformationExecutor.doLoad() executes this code:
>
> UnitProxy unit = UnitResolverFactory.Registry.INSTANCE.getUnit(fURI);
> if (unit == null) {
> /* ... cause error and return */
> }
>
> So obviously a UnitResolverFactory must be there which handles the input
> URI (specifying the *.qvto script). However, the default
> UnitResolverFactory which is present is the EclipseUnitResolverFactory,
> does not accept my URI.
>
> What I did now is I wrote my own
>
> public class MyUnitResolverFactory implements UnitResolverFactory...
>
> and registered it at the org.eclipse.m2m.qvt.oml.unitResolverFactory
> extension point. However, while that works, I'm extending a private
> interface so it's a bit shady.
>
> What is the recommended way for this to "just work", be it in a runtime
> workbench or not? The same question was asked here, but was never
> answered: http://www.eclipse.org/forums/index.php/t/238973/
>
> Thanks
> Marius
|
|
|
Re: [QVTo] UnitResolverFactory weirdness [message #856249 is a reply to message #856178] |
Wed, 25 April 2012 13:51 |
Eclipse User |
|
|
|
On 25.04.2012 14:44, Ed Willink wrote:
> Hi
>
> You haven't provided your URI so it is difficult to tell whether
>
> your URI is bad
> the QVTo code is bad
> the QVTo interface should be public
Well it's a normal platform URI, generated by
URI.createPlatformPluginURI(). It looks like this:
platform:/plugin/my.plugin.com/adir/transform.qvto
Again: if I simply squeeze in a custom UnitFactoryResolver that looks
exactly like the UnitResolverFactory.BasicRegistry it works. My only
problem is that this registry is not registered when running the debug
workbench, and that I have to hack it into it using the
org.eclipse.m2m.qvt.oml.unitResolverFactory EP.
Regards,
Marius
|
|
|
|
Powered by
FUDForum. Page generated in 0.03794 seconds