Enum value types during unmarshall throw null pointer exceptions if 
optionally mapped.

Eg :
enum Day{
    Mon,
    Tue,
    ;
}

Binding
<binding>
      <mapping ...>
        <value name="day" field="day" usage="optional"/>
    </mapping>
</binding>

A work around is to define custom deserializers per enum.(I put the 
static deserializer methods in the enum itself)
ie <value name="day" field="day" usage="optional" 
deserializer="EnumConversion.deserializeDayEnum"/>

class EnumConversion{
    public static Day deserializeDayEnum(String str) {
        if(str == null) {
            return null;
        } else {
            return Day.valueOf(str);
        }
    }
}

regards
Varghese C V

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