Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Global vars with "new" GlobalVarExtensions.getGlobalVar
Global vars with "new" GlobalVarExtensions.getGlobalVar [message #1142602] Thu, 17 October 2013 18:47 Go to next message
Christian Pelster is currently offline Christian PelsterFriend
Messages: 23
Registered: January 2010
Junior Member
Hi all,

I updated my Xtext and have the following problem:

before the update I was able to store some global vars in Xpand via:

«EXTENSION org::eclipse::xtend::util::stdlib::globalvar»

«storeGlobalVar("name", "value")»



and later access it from a java based extension with:

org.eclipse.xtend.util.stdlib.GlobalVarExtensions.getGlobalVar("name");


The problem now is that the previously static method to get/set the global vars are now non static and I have now idea how to access the variables now.


Bonus question:

How do I access the vars defined in my workflow files (inside of a java extension):

component = org.eclipse.xpand2.Generator {

		fileEncoding = fileEncoding

		globalVar = {
			name = "variable"
			value = "value"
		}
[...]

}




thanks a lot!

christian
Re: Global vars with "new" GlobalVarExtensions.getGlobalVar [message #1142609 is a reply to message #1142602] Thu, 17 October 2013 18:54 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13669
Registered: July 2009
Senior Member
have a look at http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.xpand.doc%2Fhelp%2Fr10_expressions_language.html
there is a section on the globalvar expression


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Overriding JvmTypeReferencesValidator
Next Topic:Limiting the scope to elements in the same resource
Goto Forum:
  


Current Time: Sat Dec 05 00:47:53 GMT 2020

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

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

Back to the top