[xcore] Error: Cannot find compatible feature in sealed EClass [message #1734804] |
Sun, 12 June 2016 22:36  |
Eclipse User |
|
|
|
Hi,
I wanted to override the getter method generated by xcore. But I am getting an error in my xtext grammar.
Cannot find compatible feature business in sealed EClass Directory
from imported package org.mydsl: The existing feature 'business'
is not changeable.
The content of class Directory in xcore is this:
class Directory {
String owner
String address
String business
get {
business.replace('"',"")
}
}
This is my grammar.
grammar xtext.MyDsl with org.eclipse.xtext.common.Terminals
import "org.MyDsl"
Model:
(greetings+=Greeting | directory+=Directory)*;
Greeting:
'Hello' name=ID '!';
Directory:
'Name' owner=ID 'Location' address=ID 'Type' business=ID
;
I have looked at the xcore generated java files and I noticed that the set method is not generated. May I know how I can override the getter method without affecting the set method?
|
|
|
Re: [xcore] Error: Cannot find compatible feature in sealed EClass [message #1734806 is a reply to message #1734804] |
Mon, 13 June 2016 01:53  |
Eclipse User |
|
|
|
Sorry, that's not supported. A feature with a get method will
automatically be transient, volatile, and derived. If you don't want
certain characters in the business ID string, best to disallow them in
the grammar.
On 13.06.2016 04:36, chris yo wrote:
> Hi,
>
> I wanted to override the getter method generated by xcore. But I am
> getting an error in my xtext grammar.
>
> Cannot find compatible feature business in sealed EClass Directory
> from imported package org.mydsl: The existing feature 'business'
> is not changeable.
>
>
> The content of class Directory in xcore is this:
>
> class Directory {
> String owner
> String address
> String business
> get {
> business.replace('"',"")
> }
> }
>
>
> This is my grammar.
>
> grammar xtext.MyDsl with org.eclipse.xtext.common.Terminals
>
> import "org.MyDsl"
>
> Model:
> (greetings+=Greeting | directory+=Directory)*;
>
> Greeting:
> 'Hello' name=ID '!';
>
> Directory:
> 'Name' owner=ID 'Location' address=ID 'Type' business=ID
> ;
>
>
> I have looked at the xcore generated java files and I noticed that the
> set method is not generated. May I know how I can override the getter
> method without affecting the set method?
>
|
|
|
Powered by
FUDForum. Page generated in 0.03245 seconds