Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Xpand] Accessing enum name values
[Xpand] Accessing enum name values [message #1396862] Tue, 08 July 2014 22:33 Go to next message
Nigel Daniels is currently offline Nigel DanielsFriend
Messages: 40
Registered: May 2011
Member
Hi,

in my ecore model I have classes with attributes that are enums. The
literals are what the user sees and the names are the values I want to
use in my Xpanded output but I cannot figure out how to do this.

I can access the literal value by in my template declaring:

«this.fileParameter.toString()»

but if I try:

«this.fileParameter.getName()»

then I get the following error:

782 ERROR AbstractExpressionsUsingWorkflowComponent - Error in
Component of type org.eclipse.xpand2.Generator:
EvaluationException : Couldn't find operation 'getName()' for
jas::FileParameter.
template::RDFTemplate.xpt[576,28] on line 18
'this.fileParameter.getName()'
template::RDFTemplate.xpt[371,25] on line 10 'EXPAND rule FOREACH
rules'
[23,42] on line 1 'EXPAND template::RDFTemplate::main FOR jas'

Any advice on what I can try so I can access the enums name?

Thanks for any help, Nigel.
Re: [Xpand] Accessing enum name values [message #1401553 is a reply to message #1396862] Tue, 15 July 2014 20:14 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14716
Registered: July 2009
Senior Member
Hi,

which metamodel provider do you use? javabeans? emf(registry)?
emf registry has no sophisticated support for the literals afaik.

as a workaraound you may use a java extension


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:[Acceleo] IllegalValueException
Next Topic:[Acceleo] Accessing DataType values of a stereotype
Goto Forum:
  


Current Time: Mon Sep 23 21:53:06 GMT 2024

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

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

Back to the top