Re: [Simple-support] erialize/deserialize Lists with empty Strings
Brought to you by:
niallg
|
From: Joe <fis...@ya...> - 2008-12-16 16:53:46
|
Hi,
> Your suggestion should work fine.
an optimisation is to encode only empty strings and strings starting
with the encoding prefix character.
<testData>
<_values class="java.util.Arrays$ArrayList">
<string>A</string> -> normal text
<string></string> -> null
<string>*</string> -> empty
<string>**</string> -> *
</_values>
</testData>
For better readabilty a <SPACE> could be used.
> I think there may be another
> alternative using a strategy, so that you could have.
>
> <testData>
> <_values class="java.util.Arrays$ArrayList">
> <string>A</string>
> <string null="false"></string>
> <string null="true"></string>
> </_values>
> </testData>
>
> This would basically involve adding an attribute to all elements where
> the value to be written is null. Don't know if deserialization would
> respect this though so I would have to investigate.
i like it, even more readable.
|