Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EOperation is not generated in the sub-class if the super type has one with the same signature(Code generation for EOperation in the case of inheritance)
EOperation is not generated in the sub-class if the super type has one with the same signature [message #1690926] Wed, 01 April 2015 01:33 Go to next message
Ab Shareef is currently offline Ab ShareefFriend
Messages: 1
Registered: April 2015
Junior Member
I have ClassA and ClassB defined as EClass in my ecore model. ClassA is ESuper Type of ClassB. Both of them have an EOperation of the same signature, same name and same EParameters. I realized that the method is not generated in the sub-class (ClassB in my case). I want to know why is it doing that, I tried to search the book to find out about the mechanism for generating methods in the generated java classes in the case of inheritance but I could not find anything. Can anyone guide me please. Thanks.
Re: EOperation is not generated in the sub-class if the super type has one with the same signature [message #1691016 is a reply to message #1690926] Wed, 01 April 2015 15:13 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Ab,

It detects it as a pointless override that "subverts" the operation
already implemented AImpl. Note however that if the operation in B has
a body annotation, that will be generated with the body. E.g., in Xcore
notation this

package org.example.x

class A
{
op void foo()
}

class B extends A
{
op void foo()
{

}
}

Generates this in BImpl:

/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void foo() {

}

But this does not:

package org.example.x

class A
{
op void foo()
}

class B extends A
{
op void foo()
}



On 01/04/2015 4:29 PM, Ab Shareef wrote:
> I have ClassA and ClassB defined as EClass in my ecore model. ClassA
> is ESuper Type of ClassB. Both of them have an EOperation of the same
> signature, same name and same EParameters. I realized that the method
> is not generated in the sub-class (ClassB in my case). I want to know
> why is it doing that, I tried to search the book to find out about the
> mechanism for generating methods in the generated java classes in the
> case of inheritance but I could not find anything. Can anyone guide me
> please. Thanks.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Usage of IListener/Adapter
Next Topic:[CDO] Changing datatypes between model versions
Goto Forum:
  


Current Time: Thu Apr 25 22:43:53 GMT 2024

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

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

Back to the top