Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [xcore] Error: Cannot find compatible feature in sealed EClass
[xcore] Error: Cannot find compatible feature in sealed EClass [message #1734804] Mon, 13 June 2016 02:36 Go to next message
chris yo is currently offline chris yoFriend
Messages: 146
Registered: February 2013
Senior Member
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 05:53 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31903
Registered: July 2009
Senior Member
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?
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Problem during loading the created model
Next Topic:[Xcore] Extending property view with custom property
Goto Forum:
  


Current Time: Wed Jun 16 15:03:29 GMT 2021

Powered by FUDForum. Page generated in 0.02305 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top