JiBX v1.1.3 calls deserialization methods for optional attributes, i.e.
with a structure like
<structure name="foo">
<value style="attribute" usage="optional" name="bar"
deserializer="com.foobar.JiBXHelper.deserializeBarEnum"
serializer="com.foobar.JiBXHelper.serializeBarEnum" />
</structure>
the method "com.foobar.JiBXHelper.deserializeBarEnum" gets called during
unmarshalling even when the "bar"-attribute does not exist, like with the
following XML:
<foo>
</foo>
This behavior is not what I would expect, because if there is no
"bar"-attribute to deserialize, why should its deserialization method be called?
Under
http://www.mail-archive.com/[email protected]/msg00003.html
it is stated that this behavior of JiBX is intended, but there's no explanation
given for this intention.
Although the proposed workaround of simply returning null when the method is
called with a null parameter, I would like to know what the reason for this
behavior is. Why doesn't JiBX just skip the deserialization method calls when
the attribute is not given at all?
Thanks,
Johannes Müller
--
=======================================
Johannes Sebastian Agilo Müller
Eburonenstr. 19
50678 Köln
Germany
Mail: [EMAIL PROTECTED]
Web/GnuPG key: http://www.jsam.de
=======================================
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users