ExtendedMetaData and inheritance [message #425647] |
Wed, 03 December 2008 17:20 |
Eclipse User |
|
|
|
Originally posted by: jbarkanic.gmail.com
I'm using a simple ExtendedMetaData 'name' on some of my
multiplicity-many attributes, so that the serialization uses the more
natural singular name instead of the plural. So you get something like this:
<child name="one"/>
<child name="two"/>
instead of
<children name="one"/>
<children name="two"/>
It works fine, except for those attributes that are part of an abstract
superclass. For example:
abstract ClassA{
List children
}
ClassB extends ClassA{
String someAttribute
}
I've annotated children with an ExtendedMetaData, but I still get
something like this:
<ClassB someAttribute="text">
<children name="one"/>
<children name="two"/>
</ClassB>
Have I overlooked something, or am I just out of luck trying to use this
ExtendedMetaData annotation on the attributes of abstract classes?
-Jason
|
|
|
|
Re: ExtendedMetaData and inheritance [message #425721 is a reply to message #425651] |
Fri, 05 December 2008 14:50 |
Eclipse User |
|
|
|
Originally posted by: jbarkanic.gmail.com
Thanks Ed,
I assumed it should work the way you described. My mistake was a
silly one. I had the annotation source as 'ExtendedMetaData' instead of
'http:///org/eclipse/emf/ecore/util/ExtendedMetaData'. I didn't notice
it right away since they display identically in the editor.
-Jason
Ed Merks wrote:
> Jason,
>
> Comments below.
>
>
> JBarkanich wrote:
>> I'm using a simple ExtendedMetaData 'name' on some of my
>> multiplicity-many attributes, so that the serialization uses the more
>> natural singular name instead of the plural. So you get something like
>> this:
>>
>> <child name="one"/>
>> <child name="two"/>
>>
>> instead of
>>
>> <children name="one"/>
>> <children name="two"/>
>>
>> It works fine, except for those attributes that are part of an
>> abstract superclass. For example:
>>
>> abstract ClassA{
>> List children
>> }
>>
>> ClassB extends ClassA{
>> String someAttribute
>> }
>>
>> I've annotated children with an ExtendedMetaData, but I still get
>> something like this:
>>
>> <ClassB someAttribute="text">
>> <children name="one"/>
>> <children name="two"/>
>> </ClassB>
>>
>> Have I overlooked something, or am I just out of luck trying to use
>> this ExtendedMetaData annotation on the attributes of abstract classes?
> It should work the same way. When B is serialized, it's the children
> feature of A that's being used so whether you serialize an A or a B they
> same effect should occur.
>>
>> -Jason
|
|
|
Powered by
FUDForum. Page generated in 0.02724 seconds