Skip to main content



      Home
Home » Modeling » M2T (model-to-text transformation) » Xtend - access the EnumLiterals - not possible(Xtend)
Xtend - access the EnumLiterals - not possible [message #947495] Wed, 17 October 2012 02:15 Go to next message
Eclipse UserFriend
Hello all,

I have this following issue into one file.ext that I created to generate some code out of the ecore.

String getString(Type type):
switch (type) {
case Type::Running : "Running_type"
case Type::Waiting : "Waiting_type"
default : "default"
};

Type is an Enum in my ecore and has the EnumLiterals Running and Waiting. I receive the error in the editor : Callable not found:Unknown variable, type or enumeration literal
'Type::Running'.

I have added also the check for the JavaBeansMetamodel to have it activated.
When I access this getString from the Xpand, it always takes the default case, meaning the evaluation was not done for Running or Waiting.

Maybe someone has a clue what else should I do or what should I change in the above syntax.
I add also that I don't want the getType to have it used, because I want to customize the text that I generate.

[Updated on: Wed, 17 October 2012 02:34] by Moderator

Re: Xtend - access the EnumLiterals - not possible [message #947525 is a reply to message #947495] Wed, 17 October 2012 02:51 Go to previous messageGo to next message
Eclipse UserFriend
Hi i cannot reproduce this.
are you sure you did the imports right?

Re: Xtend - access the EnumLiterals - not possible [message #947549 is a reply to message #947525] Wed, 17 October 2012 03:20 Go to previous messageGo to next message
Eclipse UserFriend
Yes, the import is done OK, for other types it works and I also have a context help.
import machine;

and machine is the package name and also the ecore name
Re: Xtend - access the EnumLiterals - not possible [message #947565 is a reply to message #947549] Wed, 17 October 2012 03:39 Go to previous message
Eclipse UserFriend
Can you share a complete example?

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de
Previous Topic:Problem installing Xpand
Next Topic:Problems running org.eclipse.acceleo:maven:3.2.1 in maven
Goto Forum:
  


Current Time: Sat Jul 12 01:00:35 EDT 2025

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

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

Back to the top