EOperation is not generated in the sub-class if the super type has one with the same signature [message #1690926] |
Tue, 31 March 2015 21:33  |
Eclipse User |
|
|
|
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 11:13  |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.05729 seconds