Hello:

I have a custom serializer/deserilizer, which basically formats String
to Date and viceversa in a abstract class Util.java

<mapping name="Flight" class="com.service.Flight"
extends="com.service.MerchantRequest" ordered="true">
   <format label="dateFormat" type="java.lang.String"
serializer="com.service.Util.serializeDate"
deserializer="com.service.Util.deserializeDate"/>
  <structure name="StayDate">                   
     <value name="CheckIn" field="_checkInDate" style="attribute" 
label="dateFormat"/>
      <value name="CheckOut" field="_checkOutDate" style="attribute" 
label="dateFormat"/>
</structure>
</mapping>

when I compile this using jibx compile

I get a error saying
Running binding compiler version jibx-beta3c
org.jibx.runtime.JiBXException: Serializer
com.service.Util.serializeDate not found

I have set my classpath and that should not be an issue.

But without using the format element definition, and by directly
specifying the serializer and/or deserializer in a value definition it
compiles without any errors.

The checkinDate object is used several places in the binding
definition so I want to reuse the label attribute from the format
element.

Please let me know if i'm missing any binding elements.

Thanks in Advance
Kiran



public static Date deserializeDate(String dateText) throws JiBXException {
        if (dateText == null) {
            return null;
        } else {
            try {
                return DATE_FORMAT.parse(dateText);
            } catch (ParseException e){
                throw new JiBXException("Invalid date format");
            }
        }
    }
    
public static String serializeDate(Date date) throws JiBXException {
        return DATE_FORMAT.format(date);
 }


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
jibx-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to