Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [XBase] Find JvmType for specific class name?
[XBase] Find JvmType for specific class name? [message #1061639] Mon, 03 June 2013 11:41 Go to next message
Alan DW is currently offline Alan DWFriend
Messages: 119
Registered: March 2012
Senior Member
Hello everyone,

I'm working on an XBase project and I need to compose the AST of an XExpression (in the JvmModelInferrer of course). This works very well by using XBaseFactory and the setters&getters of the expression classes, but now I'm at the point where I need to call a constructor to a JvmType. The problem is that all I know from this JvmType is its qualified name (as in: Java qualified name, e.g. "java.lang.RuntimeException"). The question is: how can I find or create the JvmType instance for a given qualified name? I've searched through various tutorials and info pages and the javadoc page of the XExpression and its subclasses, but I didn't find anything that suits this particular need.


Thanks,


Alan
Re: [XBase] Find JvmType for specific class name? [message #1061739 is a reply to message #1061639] Mon, 03 June 2013 17:00 Go to previous messageGo to next message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
Messages: 673
Registered: July 2009
Location: Trondheim, Norway
Senior Member
On 03.06.13 04.41, Alan DW wrote:
> Hello everyone,
>
> I'm working on an XBase project and I need to compose the AST of an
> XExpression (in the JvmModelInferrer of course). This works very well by
> using XBaseFactory and the setters&getters of the expression classes,
> but now I'm at the point where I need to call a constructor to a
> JvmType. The problem is that all I know from this JvmType is its
> qualified name (as in: Java qualified name, e.g.
> "java.lang.RuntimeException"). The question is: how can I find or create
> the JvmType instance for a given qualified name? I've searched through
> various tutorials and info pages and the javadoc page of the XExpression
> and its subclasses, but I didn't find anything that suits this
> particular need.

I use the following

@Inject extension TypeReferences
@Inject extension JvmTypesBuilder

They provide both lookup of JvmTypes and creating JvmTypeReferences

Hallvard
Re: [XBase] Find JvmType for specific class name? [message #1061885 is a reply to message #1061739] Tue, 04 June 2013 14:10 Go to previous message
Alan DW is currently offline Alan DWFriend
Messages: 119
Registered: March 2012
Senior Member
Hello Hallvard,

thank you for your answer! The "TypeReferences" class looks just like what I need, judging by its Javadoc. I'll give it a try Smile

Thanks a lot!


Alan
Previous Topic:Eclipse compiler, DSL, ant
Next Topic:Standalone generator & models in multiple jars
Goto Forum:
  


Current Time: Wed Apr 24 15:26:45 GMT 2024

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

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

Back to the top