|
|
|
Re: [Xcore] Default value for multi-valued enum attributes [message #1777922 is a reply to message #1777915] |
Wed, 06 December 2017 08:23 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
If you want defaults, yes. Alternatively you could do something like this:package org.example.list
import java.util.List
class Example
{
ValueList values = 'VALUE1 VALUE2'
}
enum Value
{
VALUE1
VALUE2
}
@ExtendedMetaData(itemType='Value')
type ValueList wraps List I.e., define an data type that's a list of enum values and then use that to define a single-value attribute with a default. Unfortunately this Xcore file has a warning about the use of the raw List type. And of course you should not modify the result of getValues() but rather call setValues with a new list to modify the value. You could also define a data type for List<Value> but in that case you have to implement the create/convert methods for that data type.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03183 seconds