Robert,
I don't know how to write the marshaller/unmarhsaller. I found it easier to modify the Utility.java code and rebuild the JiBX library.


Find the following two functions in the src\org\jibx\runtime\Utility.java file (line 369ff) and replace them with the following:

    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);
    }

        I'm going to repost this bug.

--
        Thomas Jones-Low            Softstart Services Inc.
        [EMAIL PROTECTED]      JobScheduler for Oracle
        Ph: 802-398-1012            http://www.softstart.com

Robert Augustyn wrote:
Thomas,
Thanks, I do not like that answer ...
Any idea how to write this custom
marshaller/unmarshaller?
Someone had done it I am sure ...
Is that in docs?
Thanks in advance.
robert

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Thomas
Jones-Low
Sent: Wednesday, May 19, 2004 12:13 PM
To: [EMAIL PROTECTED]
Subject: Re: [jibx-users] How to marshal single char?


Robert Augustyn wrote:

Hi,
When I try to marshal single char the jibx insist on
input in form of
the ASCII number for that char.
How can I do that?
For example I want to map '^' to a char but that

does

not work jibx
insist on having 94 instead of '^'.
What am I missing? This has to be doable.
Thanks in advance.
Robert



You can't. You either need to fix the
org.jibx.runtime.Utility.java class or use a custom marshaller/unmarshaller. I
pointed out this bug several months ago in the JiBX SourceForge bug
database. Dennis closed it claiming (IIRC) that char should be an unsigned
integer, not a character.







------------------------------------------------------- This SF.Net email is sponsored by: SourceForge.net Broadband Sign-up now for SourceForge Broadband and get the fastest 6.0/768 connection for only $19.95/mo for the first 3 months! http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click _______________________________________________ jibx-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to