Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Empty default value literal for EReference not allowed
Empty default value literal for EReference not allowed [message #414825] Fri, 23 November 2007 09:51 Go to next message
Tobias Langner is currently offline Tobias LangnerFriend
Messages: 17
Registered: July 2009
Junior Member
Hey,
when opening a EMF model (that was previously imported from a rose model)
in the GenModel, I get several errors telling that the empty string ("")
is not valid default value literal. The respective structural element is
an EReference. Is there any reason why an empty string as default value
literal for an EReference generates an error while any arbitrary string
generates a warning only?
As I understood so far, EReferences are not meant to have default value
literals set, at least the ECore editor provides no means of editing it
for an EReference. The model that we import from rose (yeah, that one
again ;) ) provides default value literals for references, though. They
are used as argument for the factory of the type in question (when code is
generated in rose). Any way how we can do that in EMF?

Thanks, cheers, Tobias
Re: Empty default value literal for EReference not allowed [message #414829 is a reply to message #414825] Fri, 23 November 2007 13:14 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Tobias,

I'm not even sure how to specify a default value for an association in
Rose... In any case, errors and warnings can all be ignored since the
builder will generally try to build a model that will not crash the
generator.

There is simply no support for default values for EReferences. They
would tend to be problematic in general. For example, for a non
containment reference, the default value would need to be contained
somewhere and even if the default value is in it's own resource, you'd
need to take steps to ensure that the resource is visible in every
resource set where the referencing object can be deserialized.. Also,
for containment references, a contained value can't be shared so a new
child would need to be created for each parent.


Tobias Langner wrote:
> Hey,
> when opening a EMF model (that was previously imported from a rose
> model) in the GenModel, I get several errors telling that the empty
> string ("") is not valid default value literal. The respective
> structural element is an EReference. Is there any reason why an empty
> string as default value literal for an EReference generates an error
> while any arbitrary string generates a warning only?
> As I understood so far, EReferences are not meant to have default
> value literals set, at least the ECore editor provides no means of
> editing it for an EReference. The model that we import from rose
> (yeah, that one again ;) ) provides default value literals for
> references, though. They are used as argument for the factory of the
> type in question (when code is generated in rose). Any way how we can
> do that in EMF?
>
> Thanks, cheers, Tobias
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Possiblity of splitting a generator description
Next Topic:Create and delete
Goto Forum:
  


Current Time: Thu Apr 25 05:07:53 GMT 2024

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

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

Back to the top