Skip to main content



      Home
Home » Modeling » EMF » [xcore] Error: Cannot find compatible feature in sealed EClass
[xcore] Error: Cannot find compatible feature in sealed EClass [message #1734804] Sun, 12 June 2016 22:36 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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?
>
Previous Topic:Problem during loading the created model
Next Topic:[Xcore] Extending property view with custom property
Goto Forum:
  


Current Time: Sun Jul 13 13:11:15 EDT 2025

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

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

Back to the top