Hello.
I have a bean that contains a member whose type varies from one instance
of the bean to another (Strings, numbers, dates, etc):
class MyBean {
private Object value;
}
I mapped this field with type="other":
<field name="value" type="other">
<bind-xml name="value" node="element"/>
</field>
If the field value is a java.util.Date, I get this by marshalling the bean:
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="date">2007-02-14T15:36:11.800+02:00</value>
This looks fine, but on unmarshalling I get an
org.exolab.castor.types.AnyNode instead of a java.util.Date.
Unmarshalling works fine for String and numerical values.
Is this a bug/limitation or am I missing something? If it's a bug, is
there any workaround? This happens on 1.1 and on SVN trunk.
If I change
org.exolab.castor.xml.descriptors.DateClassDescriptor.getXMLName() to
return null instead of "date", then the marshaller produces
xsi:type="java:java.util.Date" instead of xsi:type="date" and
unmarshalling works fine.
Also, if my bean contains a java.util.Date field, then xsi:type="date"
works fine on unmarshalling.
Regards,
Lucian Chirita
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email