Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Ecore to JvmTypes mapping
Ecore to JvmTypes mapping [message #699830] Fri, 22 July 2011 07:44 Go to next message
Eclipse UserFriend
Originally posted by:

Hi,

I'm still working on inferring a Jvm model for an Ecore model and have
come to EDataTypes. I use an injected TypeReferences object to get
references to the JvmDeclaredType corresponding to the EDataType's
instanceClassName. However, the getTypeForName method takes a class name
and its parameters as its arguments, hence, I must parse parameterized
types like java.util.List<java.lang.String> myself. I'm sure there is a
method somewhere that already does this, but where?

Hallvard
Re: Ecore to JvmTypes mapping [message #700265 is a reply to message #699830] Sat, 23 July 2011 00:54 Go to previous messageGo to next message
Eclipse UserFriend
Not sure whether this fits your needs, but EcoreValidator.EGenericTypeBuilder.handleInstanceTypeName(...) apparently does exactly that. It returns an EGenericType, though.

HTH,

Mirko
Re: Ecore to JvmTypes mapping [message #700388 is a reply to message #700265] Sat, 23 July 2011 06:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by:

On 23.07.11 06.54, Mirko Raner wrote:
> Not sure whether this fits your needs, but
> EcoreValidator.EGenericTypeBuilder.handleInstanceTypeName(...)
> apparently does exactly that. It returns an EGenericType, though.

Yes, I need the corresponding parser for JvmType. I guess I can get some
inspiration from the source.

Hallvard
Re: Ecore to JvmTypes mapping [message #700508 is a reply to message #700388] Sat, 23 July 2011 11:03 Go to previous messageGo to next message
Eclipse UserFriend
Hallvard,

I think it does exactly what you'd need, i.e., it creates the full
structure that you can navigate. EDataType instances are created to
represent the qualified names.


On 23/07/2011 3:10 AM, Hallvard Trætteberg wrote:
> On 23.07.11 06.54, Mirko Raner wrote:
>> Not sure whether this fits your needs, but
>> EcoreValidator.EGenericTypeBuilder.handleInstanceTypeName(...)
>> apparently does exactly that. It returns an EGenericType, though.
>
> Yes, I need the corresponding parser for JvmType. I guess I can get
> some inspiration from the source.
>
> Hallvard
Re: Ecore to JvmTypes mapping [message #700668 is a reply to message #700508] Sat, 23 July 2011 17:13 Go to previous message
Eclipse UserFriend
Originally posted by:

On 23.07.11 17.03, Ed Merks wrote:
>
> I think it does exactly what you'd need, i.e., it creates the full
> structure that you can navigate. EDataType instances are created to
> represent the qualified names.

You mean traverse this Ecore structure and create the corresponding Jvm
structure? That should be simpler than parsing manually, if the
structures are isomorphic (which they should, since they represent the
same thing).

Hallvard
Previous Topic:[Xtext2] Extending XbaseCompiler
Next Topic:How do I get a IEObjectDescription from EObject?
Goto Forum:
  


Current Time: Tue Jul 15 15:25:59 EDT 2025

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

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

Back to the top