|
|
|
Re: Base class retrieved value from eStaticClass() method [message #1598099 is a reply to message #1597551] |
Mon, 02 February 2015 19:50 |
Ed Merks Messages: 33216 Registered: July 2009 |
Senior Member |
|
|
Basheer,
Comments below.
On 02.02.2015 12:26, Basheer Jasser wrote:
> Ed.,
>
> Comments below.
>
> On 02.02.2015 04:49, Basheer Jasser wrote:
>> I'm dealing with E-core diagram where I have meta-class A generalized
>> from meta-class B which in turn generalized from meta-class C. The
>> retrieved baseclass value from "protected EClass eStaticClass(){}"
>> generated method is the class A itself while in other cases using the
>> same meta-model the retrieved value is class C.
> In a generated model's implementation class, it should always be the
> EClass being implemented.
>
> As in this fraction of the diagram in Figure 1 which shows the generalization between different meta-classes , and the generated code in class A which is shown below
> ------------------------------------------------------------
> public class AImpl extends BImpl implements A {
> /**
> * <!-- begin-user-doc -->
> * <!-- end-user-doc -->
> * @generated
> */
> protected AImpl() {
> super();
> }
> /**
> * <!-- begin-user-doc -->
> * <!-- end-user-doc -->
> * @generated
> */
> @Override
> protected EClass eStaticClass() {
> return MyPackage.Literals.A;
> }
>
> } //AImpl
> ------------------------------------------------------------
> So the natural behavior of eStaticClass() is to obtain class A as a returned value and it is not possible to return the generalized meta-class B or C ???
Yes, AImpl's eStaticClass must always return A's EClass instance.
>
> I'm facing some cases in the original project which is giving class C as the returned value ( I don't know why ). So maybe there is something to which is affecting eStaticClass() method behavior to return class C as retrieved value.
It seems impossible for a generated model, i.e., eStaticClass() ==
eClas() for instances of generated models. For a dynamic model that
extends a generated model, the two will be different.
>
>> The question is "is there something to do so that I control the
>> retrieved baseclass value from eStaticClass method whether it should be
>> the same class A dealt with or the generalized class C ? "
> I'm not sure if you mean something special by 'baseclass'...
>
> The baseclass is the name of debugger variable which is representing the returned value of eStaticClass() method.
>
>
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03482 seconds