users@jaxb.java.net

Customization question

From: Noel Rappin <nrappin_at_SOCKEYE.COM>
Date: Mon, 04 Nov 2002 16:43:00 -0500

I have an XML document that looks something like this (simplified, of
course...):

<parent>
        <child name="fred"/>
        <child name="barney"/>
        <child name="wilma"/>
</parent>

What I get out of JAXB is a Parent interface that has a List property
Child. This is fine. However, when the item is marshaled, I'd also
like to have the Child objects be inserted into a Map, where the name
attribute is the key, and the Child object is the value.

I've been trying to figure out how to get JAXB to bind to a custom class
that implements the parent interface and that will do this, but don't
think I've quite figured it out. Is there a way to get JAXB to do what
I want?

Thanks,

Noel Rappin