|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Defining which derived class a feature from an abstract class shall use [message #941550 is a reply to message #941203] |
Fri, 12 October 2012 16:31 |
Ed Merks Messages: 33218 Registered: July 2009 |
Senior Member |
|
|
John,
Comments below.
On 12/10/2012 11:43 AM, John M. wrote:
> I am on the way to figure out, why I get a
> Java.io.NotSerializableException: HeaderDefinitionFieldImpl.
> I have created a EDatatype with the instance class
> org.eclipse.emf.common.util.EMap, for the use of ? extends
> AbstractDefinitionField.
Yes, likely that should be marked as serializeable false because you
can't really convert such values to and from a string...
>
> It fails while calling the method
> BasicEMap.writeObject(entry.getValue) on line 1530. Perhaps I shall
> use some other map implementation.
No, because you need EReferences to serialize references to EObjects.
> I adjusted the method createHeaderDefinition, that values get an
> instance of BasicEMap.
> But I would say something is wrong with my HeaderDefinitionField in
> work with the BasicEMap.
No, I only told you do use this type of thing to define the type of an
operation, not the type of a feature.
>
> StringToHeaderDefinitionField works without any problems, but with it
> I can't define the getValues EOperation like I have done it yet.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
|
Re: Defining which derived class a feature from an abstract class shall use [message #942382 is a reply to message #942321] |
Sat, 13 October 2012 13:06 |
Ed Merks Messages: 33218 Registered: July 2009 |
Senior Member |
|
|
John,
Comments below.
On 13/10/2012 1:52 PM, John M. wrote:
> There is only a little problem, but in this case with a single valued
> feature.
>
> I defined an abstract EClass containing two methods getDefinition
> returns X and setDefinition takes X.
> A derived EClass defines the feature definition from Type Y extends X.
> The method getDefinition is correctly generated like getDefition
> returns Y.
> But there are two methods setDefinition one takes X and the other one
> takes Y.
> Is it possibile to say that only setDefinition for Y shall be generated?
No. This notion of covariant return types doesn't apply for arguments.
For arguments you are defining an overloaded method. If you really are
trying to match what's done for multi-valued, in that case you can't add
to the list, so for the single valued case you should not have a set method.
>
> I hope there are enough information on the first try. :)
>
> Some pictures can be found in my post above
> (http://www.eclipse.org/forums/index.php/mv/msg/398079/940055/#msg_940055).
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|