[Xcore] Setting default value of a string [message #1735188] |
Thu, 16 June 2016 04:34  |
Eclipse User |
|
|
|
I want to set the default value of a string which is defined in a static variable in xtend.
But I am getting this error:
Multiple markers at this line
- missing RULE_STRING at 'MyStaticObjects'
- MyStaticObjectscannot be resolved to a type.
- extraneous input '::' expecting RULE_ID
- A generic type in this context must refer to a classifier or
a type parameter
I use it like this:
class Directory {
String name = MyStaticObjects::DEFAULT_NAME
}
May I know how to initialize a string to a static variable?
|
|
|
|
|
Re: [Xcore] Setting default value of a string [message #1735323 is a reply to message #1735288] |
Fri, 17 June 2016 07:17  |
Eclipse User |
|
|
|
Chris,
No, not really. In the end, an Xcore instance just maps to an Ecore and
GenModel instance, and an EStructuralFeature has a "default value"
literal attribute, i.e., a fix constant, not some expression that would
need to be evaluated at runtime...
On 16.06.2016 22:35, chris yo wrote:
> Is there a plan to add this feature in the future? This will be
> something nice to have.
|
|
|
Powered by
FUDForum. Page generated in 0.03798 seconds