The following issue has been updated:
Updater: Dennis Sosnoski (mailto:[EMAIL PROTECTED])
Date: Sun, 30 May 2004 3:56 PM
Comment:
Added serializer/deserializer support for this case. You can make it the default for
any binding by adding this as a child of the <binding> element:
<format type="char" serializer="org.jibx.runtime.Utility.serializeCharString"
deserializer="org.jibx.runtime.Utility.deserializeCharString"/>
You can alternatively specify the single-character string binding for a particular
char value as:
<value name="e" field="e" format="char:string"/>
Since at least some users are working with the existing 16-bit unsigned integer
serialization for chars I'm not going to change the JiBX default for this.
Changes:
Fix Version changed to CVS
---------------------------------------------------------------------
For a full history of the issue, see:
http://jira.codehaus.org/browse/JIBX-21?page=history
---------------------------------------------------------------------
View the issue:
http://jira.codehaus.org/browse/JIBX-21
Here is an overview of the issue:
---------------------------------------------------------------------
Key: JIBX-21
Summary: JiBX won't (un)marshal single characters
Type: Improvement
Status: Open
Priority: Minor
Original Estimate: Unknown
Time Spent: Unknown
Remaining: Unknown
Project: JiBX
Components:
core
Fix Fors:
CVS
Versions:
1.0-beta3b
Assignee: Dennis Sosnoski
Reporter: Thomas Jones-Low
Created: Wed, 19 May 2004 1:53 PM
Updated: Sun, 30 May 2004 3:56 PM
Description:
JiBX refuses to (un)marshal single character values. The JiBX runtime utility insists
upon improperly treating characters unsigned integers.
test case:
<binding>
<mapping name="testcase" class="TestCase">
<value name="name" field="name">
<value name="yesno" field="yesno">
</mapping>
</binding>
public class TestCase
{
String name;
char yesno;
}
<testcase>
<name>test name</name>
<yesno>Y</name>
</testcase>
The fix to this issue is to update the two functions in the runtime utility module:
public static char parseChar(String text) throws JiBXException {
if (text.length() != 1)
throw new JiBXException ("Value out of range");
return text.charAt(0);
}
public static String serializeChar(char value) {
return Character.toString(value);
}
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
-------------------------------------------------------
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-devs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jibx-devs