Resolve java scheme uris [message #841623] |
Wed, 11 April 2012 14:58 |
Hallvard Traetteberg Messages: 673 Registered: July 2009 Location: Trondheim, Norway |
Senior Member |
|
|
Hi,
I'm using Xtext for defining a DSL for a state machine, with Xbase for
defining events (when Xbase expression changes), conditions (boolean
Xbase expression) and actions (any Xbase expression). I transform the
model provided by Xtext to another one, which is saved as an ordinary
xmi file. This file has lots of references to Xbase/Xtype objects using
java: URIs, which I assume refer to Java types and methods on the
classpath. Unfortunately, these are not resolved, so I end up with
proxies. .
My xmi resource is loaded into an XMIResource, while I notice that my
IGenerator gets the original data (from Xtext) in an XbaseResource and
there's lots of TypeResources that I assume hold the model objects
corresponding to Java classes and methods. What is the proper way of
configuring my injector (or whatever's needed) so I get the appropriate
Resource implementation for my data, so the java: uris are resolved?
Hallvard
|
|
|
Re: Resolve java scheme uris [message #841921 is a reply to message #841623] |
Wed, 11 April 2012 21:24 |
Hallvard Traetteberg Messages: 673 Registered: July 2009 Location: Trondheim, Norway |
Senior Member |
|
|
I debugged the generator, where java schemes resolve correctly, and
found that the protocol map contained an instance of
ClasspathTypeProvider and that such an object is created by
ClasspathTypeProviderFactory instances. I used to following code to add
a ClasspathTypeProvider to the protocol map:
ClasspathTypeProviderFactory classpathTypeProviderFactory =
injector.getInstance(ClasspathTypeProviderFactory.class);
classpathTypeProviderFactory.createTypeProvider(resourceSet);
So far it seems to work...
Hallvard
On 11.04.12 16.58, Hallvard Trætteberg wrote:
> Hi,
>
> I'm using Xtext for defining a DSL for a state machine, with Xbase for
> defining events (when Xbase expression changes), conditions (boolean
> Xbase expression) and actions (any Xbase expression). I transform the
> model provided by Xtext to another one, which is saved as an ordinary
> xmi file. This file has lots of references to Xbase/Xtype objects using
> java: URIs, which I assume refer to Java types and methods on the
> classpath. Unfortunately, these are not resolved, so I end up with
> proxies. .
>
> My xmi resource is loaded into an XMIResource, while I notice that my
> IGenerator gets the original data (from Xtext) in an XbaseResource and
> there's lots of TypeResources that I assume hold the model objects
> corresponding to Java classes and methods. What is the proper way of
> configuring my injector (or whatever's needed) so I get the appropriate
> Resource implementation for my data, so the java: uris are resolved?
>
> Hallvard
|
|
|
Powered by
FUDForum. Page generated in 0.02313 seconds