Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Java Generation with Xbase from an EClass object(I want to generate Java code from an EClass but have trouble generating type arguments)
Java Generation with Xbase from an EClass object [message #1398949] Fri, 11 July 2014 21:02
Olaf Bigalk is currently offline Olaf BigalkFriend
Messages: 141
Registered: July 2009
Location: Berlin
Senior Member
I have setup a little project for generating code from the ecore class "EClass".
I try to generate the following:
public class EClassWalkable implements IWalkable<EClass, EClassWalker> {
}

But I get this:
public class EClassWalkable implements org.xtext.example.mydsl10.jvmmodel.IWalkable {
}

For simplicity I ommited the methods.
As I figured out by debugging is that the type reference resolution process could not find a resourceSet for EClass. That led the process to not correctly generate the type parameter of the IWalkable interface.

I used "EcorePackage.eINSTANCE.EClass" to get the EClass object.
Now my questions:
Is this a bug or a feature ?
Is there another way to get the EClass object beeing attached to it's resourceSet ?

The zip consists of three projects:
org.eclispe.example.mydsl10 - the DSL Project currently only used for triggering the xbase code generation
org.eclispe.example.mydsl10.ui - the DSL Project currently only used for triggering the xbase code generation
org.eclispe.example.mydsl10.test - the DSL Instance Project currently only used for triggering the xbase code
generation

org.eclispe.example.mydsl10.test imports org.eclispe.example.mydsl10 and org.eclipse.emf.ecore

I removed the binary files since they will be generated by running the workflow or the generator

The both classes of interesst are
org.xtext.example.mydsl10.jvmmodel.MyDslJvmModelInferrer - generated by Xtext
org.xtext.example.mydsl10.jvmmodel.EcoreWalkableInferrer - hand made

Previous Topic:new run configuration eclipse from web
Next Topic:how to use logging
Goto Forum:
  


Current Time: Thu Dec 05 17:56:16 GMT 2019

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

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

Back to the top