Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Xtend] access static field/method
[Xtend] access static field/method [message #659299] Fri, 11 March 2011 22:09 Go to next message
Jens von Pilgrim is currently offline Jens von PilgrimFriend
Messages: 313
Registered: July 2009
Senior Member
Hi,

something I always wanted to know but never dared to ask: How can I
access a static field or method of a Java class/interface from Xtend?

E.g., how can I retrieve the EcorePackage.eINSTANCE field? (Which I
actually need for retrieving ecore metamodel types).

Cheers,

Jens
Re: [Xtend] access static field/method [message #659340 is a reply to message #659299] Sat, 12 March 2011 13:35 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

what about writing a JAVA Extension that calls a Helper Method in a Java Class that returns the static member.

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [Xtend] access static field/method [message #659344 is a reply to message #659340] Sat, 12 March 2011 14:25 Go to previous message
Jens von Pilgrim is currently offline Jens von PilgrimFriend
Messages: 313
Registered: July 2009
Senior Member
On 12.03.11 14:35, Christian Dietrich wrote:
> what about writing a JAVA Extension that calls a Helper Method in a Java
> Class that returns the static member.

That's how I solved that problem hitherto. However I was wondering if
there is no way of doing that in Xtend/Xpand directly.

Cheers,
Jens
Previous Topic:[XPand2] Overwriting of read-only files
Next Topic:[Xpand] super() equivalent for DEFINE methods?
Goto Forum:
  


Current Time: Thu Apr 25 23:28:44 GMT 2024

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

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

Back to the top