Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Accessing global constant data
Accessing global constant data [message #1064598] Thu, 20 June 2013 08:02 Go to next message
chris yo is currently offline chris yo
Messages: 37
Registered: February 2013
Member
How can I access a global constant data from another class?

class Form {
val FORM_NAME = "form101"
}

class FormGen {
 def void processForm()
 {
   // need to get the FORM_NAME here.
 }
}


Any idea how to get this FORM_NAME? I have tried FormGen::FORM_NAME, but it does not seem to work. Do I need to import FormGen?
Re: Accessing global constant data [message #1064608 is a reply to message #1064598] Thu, 20 June 2013 08:40 Go to previous message
Alexander Nittka is currently offline Alexander Nittka
Messages: 1156
Registered: July 2009
Senior Member
Hi,

FORM_NAME is neither static nor public .

val public static FORM_NAME=...

Note that there is a "Generated Code"-View for simple access to the compiled java code. This would have told you, why FORM_NAME was not visible.

Alex


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de

[Updated on: Thu, 20 June 2013 08:42]

Report message to a moderator

Previous Topic:Cyclic resolution of lazy links
Next Topic:Xtext runtime tries to access internet at application startup
Goto Forum:
  


Current Time: Sat Sep 20 20:11:39 GMT 2014

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

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