You can use the <format> tag (my preference) or directly the serializer,
deserializer attribute with a custom made formater (the one provided use
the - separators).

In a class you need the following methods:

public static String serializeDashDate(java.util.Date date) {
        return sdf.format(date);
}
public static java.util.Date deserializeDashDate(String date) {
        return sdf.parse(date);
}
private static java.text.SimpleDataFormat sdf=new
java.text.SimpleDataFormat("yyyy-mm-dd");

Then in your binding file:
<binding>
        <format label="DashDate"
serializer="com.mystuff.Converter.serializeDashDate"
deserializer="com.mystuff.Converter.deserializeDashDate"/>
        <mapping..>
                <value name="date" field="date" format="DashDate"/>
                ..
        </mapping>
</binding>

I didn't really compile any of the above, but that should get you there.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ronald
Johnson
Sent: Friday, March 16, 2007 11:53 AM
To: [email protected]
Subject: [jibx-users] mapping to java.util.Date?

hm, i cant find an example for this:

i want to map xml element of the form

<somedate>31.12.2004</somedate>

to an attribute of type java.util.Date
Date someDate;

how can this be done?

------------------------------------------------------------------------
-
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=DEVDE
V
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users


-------------------------------------------------------------------------
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

Reply via email to