serialization custom and unserializable-parents

212 views
Skip to first unread message

Samuel Perez

unread,
Nov 8, 2016, 11:34:03 PM11/8/16
to XStream User
I have an object bytes on the wire that i am trying to write to XML and then read back from xml to bytes to send on the wire.

The request object gets converted to xml like this, what does this mean?
serialization="custom"
also, what does <unserializable-parents/> mean and how can i write the xml correctly to account for the time classes?

<flightLegStatus>
<arrivalStatus>On Time</arrivalStatus>
<departureStatus>On Time</departureStatus>
<departureActualTime>
<iLocalMillis>25200000</iLocalMillis>
<iChronology class="iChronology" serialization="custom">
<unserializable-parents/>
<assembledChronology>
<default>
<iParam class="object-array">
<julianChronology serialization="custom">
<unserializable-parents/>
<assembledChronology>
<default/>
</assembledChronology>
<org.joda.time.chrono.BasicChronology>
<default>
<iMinDaysInFirstWeek>4</iMinDaysInFirstWeek>
</default>
</org.joda.time.chrono.BasicChronology>
</julianChronology>
<gregorianChronology serialization="custom">
<unserializable-parents/>
<assembledChronology>
<default/>
</assembledChronology>
<org.joda.time.chrono.BasicChronology>
<default>
<iMinDaysInFirstWeek>4</iMinDaysInFirstWeek>
</default>
</org.joda.time.chrono.BasicChronology>
</gregorianChronology>
<instant>
<iMillis>-12219292800000</iMillis>
</instant>
</iParam>
</default>
</assembledChronology>
<iChronology>
<default>
<iCutoverMillis>-12219292800000</iCutoverMillis>
<iGapDuration>864000000</iGapDuration>
<iCutoverInstant reference="../../../assembledChronology/default/iParam/instant"/>
<iGregorianChronology reference="../../../assembledChronology/default/iParam/gregorianChronology"/>
<iJulianChronology reference="../../../assembledChronology/default/iParam/julianChronology"/>
</default>
</iChronology>
</iChronology>
</departureActualTime>
<arrivalActualTime>
<iLocalMillis>29100000</iLocalMillis>
<iChronology class="iChronology" reference="../../departureActualTime/iChronology"/>
</arrivalActualTime>
<departureScheduledTime>
<iLocalMillis>25200000</iLocalMillis>
<iChronology class="iChronology" reference="../../departureActualTime/iChronology"/>
</departureScheduledTime>
<arrivalScheduledTime>
<iLocalMillis>29100000</iLocalMillis>
<iChronology class="iChronology" reference="../../departureActualTime/iChronology"/>
</arrivalScheduledTime>
</flightLegStatus>

Jörg Schaible

unread,
Nov 9, 2016, 3:51:22 AM11/9/16
to xstrea...@googlegroups.com
Hi Samuel,

Samuel Perez wrote:

> I have an object bytes on the wire that i am trying to write to XML and
> then read back from xml to bytes to send on the wire.
>
> The request object gets converted to xml like this, what does this mean?
> serialization="custom"
> also, what does <unserializable-parents/> mean and how can i write the xml
> correctly to account for the time classes?

[snip]

XStream serializes Java objects to XML and back. And it takes care that the
deserialized object is the same as before. This XML is what it takes to
serialize and deserialize this object. At least as long as the generic
SerializationConverter is used.

While it is probably possible to write more specialized converters, someone
has to do it. See issue #75.

Cheers,
Jörg

Reply all
Reply to author
Forward
0 new messages