Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Access members of JvmTypeReference
Access members of JvmTypeReference [message #1660789] Mon, 09 March 2015 10:39 Go to next message
Ma DeWael is currently offline Ma DeWaelFriend
Messages: 6
Registered: March 2015
Junior Member
Dear All

One of my grammar rules is
Representation:
	rep = JvmTypeReference;


How can I (in my infer-methods) access the members of this Java Type?

E.g. from the Jvm Type A (below) I want to know it has a method
f

// Java:
class A {
 int x;
 boolean f() { /**/ return true; }
}



Concretely if would like to generate the following:
class A_prime extends A {
boolean f() {
    log();
    return super.f();
}


Re: Access members of JvmTypeReference [message #1661168 is a reply to message #1660789] Mon, 09 March 2015 14:06 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
HI,

did you try to downcast getType e.g. to JvmDeclaredType and navigate from there?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Access members of JvmTypeReference [message #1663653 is a reply to message #1661168] Tue, 10 March 2015 14:28 Go to previous messageGo to next message
Ma DeWael is currently offline Ma DeWaelFriend
Messages: 6
Registered: March 2015
Junior Member
Thats seems to do the trick!
Is there some documentation available that describes the "model" used by XBase?
Re: Access members of JvmTypeReference [message #1663698 is a reply to message #1663653] Tue, 10 March 2015 14:54 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
No there is ZERO docs on Xbase (besides use of JvmModelInferrer)

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:generate plugin
Next Topic:Don't create Xtend classes with the same name as data rules
Goto Forum:
  


Current Time: Fri Mar 29 00:50:42 GMT 2024

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

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

Back to the top