Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Custom serialization of Map$Entry
Custom serialization of Map$Entry [message #653720] Thu, 10 February 2011 20:20 Go to next message
Missing name Missing name is currently offline Missing name Missing nameFriend
Messages: 13
Registered: October 2010
Junior Member
Hello,

I have a class that has a containment reference of type StringToValueMapEntry with multiplicity 0..*. StringToValueMapEntry is a java.util.Map$Entry with an attribute key of type EString and a value of type Value. Finally, Value is a class with two attributes, a and b of type EString.

The default serialization produces

<element key="key">
<value a="value of a" b="value of b"/>
</element>

I would like to have

<element key="key" a="value of a" b="value of b"/>

instead.

How can I achieve this? Any help will be very much appreciated.

Cheers,
Stanislav
Re: Custom serialization of Map$Entry [message #653778 is a reply to message #653720] Fri, 11 February 2011 07:05 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 30653
Registered: July 2009
Senior Member
Stanislav,

You'd have to specialize XMLHandler and XMLSaveImpl to achieve such a
result. It will be quite a bit of work.


Stanislav wrote:
> Hello,
>
> I have a class that has a containment reference of type
> StringToValueMapEntry with multiplicity 0..*. StringToValueMapEntry is
> a java.util.Map$Entry with an attribute key of type EString and a
> value of type Value. Finally, Value is a class with two attributes, a
> and b of type EString.
>
> The default serialization produces
>
> <element key="key">
> <value a="value of a" b="value of b"/>
> </element>
>
> I would like to have
>
> <element key="key" a="value of a" b="value of b"/>
>
> instead.
>
> How can I achieve this? Any help will be very much appreciated.
>
> Cheers,
> Stanislav
Previous Topic:Notifications on creation of EObjects
Next Topic:Help with ChangeRecorder / workbench-wide model
Goto Forum:
  


Current Time: Thu Nov 21 13:21:30 GMT 2019

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

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

Back to the top