Thomas Jones-Low wrote:

Dennis Sosnoski wrote:


It's very easy to override this behavior if you want to handle a char value as a single character string, without modifying the code. Just define the same methods you've listed below in your own code, then reference them in your binding as serializer/deserializer. You can use the serializer/deserializer on a particular value, or define them as the defaults for all values of this type with a <format>. See the tutorial at http://jibx.sourceforge.net/tutorial/binding-extend.html#serdeser for details. This would probably be a good item to add to the Wiki, if one of you would be willing to do that.

For the next version I'll include these as part of the Utility classes (with names like parseCharString and serializerCharString) just to make it even easier. If there's that much interest I can even make them the default for chars. I hate changing defaults unnecessarily, though, since that may break someone else's code.




It would greatly aid in my work to make this the default behavior. Having JiBX treat char as unsigned int values and no ability to read single characters into char variables is completely baffling behavior.




The reason it treats chars as unsigned shorts currently is because that's technically what they are in Java. It hadn't occurred to me that people would be using specifically single-character data values. Still, it's easy to change the default, and you can just include the single necessary <format> to do this in each of your binding files until I make the change in JiBX.

 - Dennis



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
jibx-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to