Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Unsettable enum handling(Serializer calling isSet())
Unsettable enum handling [message #698484] Tue, 19 July 2011 14:41 Go to next message
Balazs Varnai is currently offline Balazs VarnaiFriend
Messages: 21
Registered: June 2011
Junior Member
Hi,

Consider the following grammar

enum DirectionEnum:
	in | inout | out;

Parameter:
	direction=DirectionEnum name=ID;


I populate the model as

Parameter param = DslFactory.createParameter();
param.setDirection(DirectionEnum.in);

/* resource.save(null) */


During serialization isSet() is called, which in turn checks if the 'direction' is set to default, if so returns unset. This causes to serializer to fail immediately, since it's mandatory?

Any suggestion?

Thanks!
Re: Unsettable enum handling [message #699095 is a reply to message #698484] Wed, 20 July 2011 20:12 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13591
Registered: July 2009
Senior Member
Hi,

the problem is the missing name, not the direction or enum Wink

for the strage error message

Exception in thread "main" java.lang.RuntimeException: foo bar
Semantic Object: Parameter

i filed https://bugs.eclipse.org/bugs/show_bug.cgi?id=352672
for the strage error message

~Christian


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:[Xbase] FeatureCall Scoping problems with DomainModelExample
Next Topic:View source for org.eclipse.emf.mwe2.runtime.workflow.Workflow
Goto Forum:
  


Current Time: Sat Sep 19 13:29:14 GMT 2020

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

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

Back to the top