|
Re: Attributes of type EnumSet<E>? [message #425154 is a reply to message #425152] |
Mon, 17 November 2008 17:52 |
Eclipse User |
|
|
|
Originally posted by: cdamus.zeligsoft.com
Hi, Andreas,
Only Ed can speak to plans, but you can define an EDataType with
java.util.EnumSet as the "instanceTypeName." You can even add the E
generic type parameter (remember to enable Generics in the Ecore Editor
menu).
Then, it's just a matter of implementing the
createFromString/convertToString methods in your generated FactoryImpl
to serialize the enum-set values.
HTH,
Christian
Andreas Mayer wrote:
> In my model, I have several enums that can be combined, for example,
> privileges such as READ, WRITE, and DELETE. Therefore, some classes have
> multi-valued attributes of such enums.
>
> EMF converts an EEnum into a Java enum, but uses an EList for a
> multi-valued enum attribute. I would prefer to use an EnumSet instead.
> Aside from the more efficient implementation, EnumSet.equals() ignores
> the order in which the values have been added.
>
> Is there a way to force the code generator to use EnumSet instead of
> EList here? Are there any plans to add some sp ecial handling for
> multi-valued enum attributes?
>
> Andreas
>
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02664 seconds