Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Resolve java scheme uris
Resolve java scheme uris [message #841623] Wed, 11 April 2012 14:58 Go to next message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
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 Go to previous message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
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
Previous Topic:Editor
Next Topic:xtext 2 sources
Goto Forum:
  


Current Time: Fri Apr 19 21:40:26 GMT 2024

Powered by FUDForum. Page generated in 0.02313 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top