Using an array of interfaces is something I don't think I've ever tried.
For this to work at all I think you'd need to define a <mapping
abstract="true"...> for the interface itself, then have the <mapping>
for the class extend the <mapping> for the interface. If you do that I
think this should work.
- Dennis
GiaNe wrote:
Hi All,
I tried to use TypeArrayMapper on an Object which contains an array Interface
Object such as the following:
public MyObject
{
MyInterface[ ] myInterfaces;
String anAttribute;
}
public interface MyInterface
{
String filed1;
String field2;
}
<mapping class="MyObject"
value-style="attribute" >
<value name="Att"
getMethod="getAnAttribute"
setMethod="setAnAttribute"/>
<structure name="Array"
getMethod="getMyInterfaces"
setMethod="setMyInterfaces"
marshaller="org.jibx.extra.TypeArrayMapper"
unmarshaller="org.jibx.extra.TypeArrayMapper"/>
</mapping>
public Myclass implements MyInterface{ }
<mapping class="MyClass">
.....
</mapping>
I am able to UnMarshall MyObject correctly, however, when Marshalling, I
received this error:
org.jibx.runtime.JiBXException: Invalid object type for marshaller.
Thanks in advance for helping
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users