|Re: Problem with redefining enum property [message #624092]
||Thu, 26 July 2007 18:26
| Ed Merks
Registered: July 2009
It's not possible to define a new enumeration based on an existing one
since Java has no concept of one enumeration restricting or extending
another. So to me it seems that you can't expect this concept to map
properly onto Java. It's best to ask about this on the UML2 newsgroup,
because I don't understand some of these concepts very well, so I've
added it to the "to" list of the reply.
Andreas Werner wrote:
> Hi newsgroup,
> I have created a uml metamodel containing a class X that extends
> uml::Class from the UML2 metamodel. In X I redefined the property
> visibility : VisibilityKind, which is initially defined in
> uml::PackagableElement. Therefore I created a new Enumeration
> NewVisibilityKind which extends VisibilityKind and put it into X as a
> redefining type for visibility. So far in the UML World everything
> works fine!
> But if I create an Ecore model from it, the problem is that
> NewVisibilityKind is not defined as a sub type from VibilityKind but
> an enum. Thus the generated code won't work, because the getter for
> NewVisibilityKind is not returning an instance of VisibilotyKind!
> Does anyone know a workaround for this issue?
> Please help, Andreas
Powered by FUDForum
. Page generated in 0.01705 seconds