Hi everyone,

Apologies if this has been answered previously on the list but the related topics (and their solutions) did not seem to work for me. I have a class structure which looks something like the following:

public interface IFoo
{
}

public class MyFoo implements IFoo
{
    private String _s1;
    private String _s2;
}

public class YourFoo implements IFoo
{
    private int _i1;
}

public class FooUser
{
    private IFoo _theFoo;
}

Essentially a simple class of an instance variable represented as an interface with a couple of concrete implementations. My binding definition has the following elements:

<mapping class="IFoo" abstract="true" />

<mapping class="MyFoo" abstract="true" extends="IFoo">
    <value name="s1" field="_s1" />
    <value name="s2" field="_s2" />
</mapping>

<mapping class="YourFoo" abstract="true" extends="IFoo">
    <value name="i1" field="_1" />
</mapping>

<mapping name="bar" class="FooUser">
    <structure name="theFoo" field="_theFoo" />
</mapping>

This seems to compile fine but when attempting to marshal a FooUser the XML element for "theFoo" always outputs as empty, i.e.

<bar><theFoo /></bar>

I've tried using a map-as in the structure with no luck, This is using either JiBX 1.0.1 or 1.1 b2. Thanks in advance for any insight!

Best Regards,

-- Mike

Reply via email to