users@jaxb.java.net

Re: JAXB marshalling recurzive object strucutre

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Wed, 02 Aug 2006 08:42:30 -0700

Ed Mooney wrote:
> Hi Norbert,
>
> JAXB throws an exception when it detects a cycle. There's no way around
> it, that I know.

Certain things can be done by using @XmlID and @XmlIDREF.

For example, this particular one could be:

class Person {
   @XmlElement @XmlID String name;
   @XmlElement Firm firm;
}

class Firm {
   @XmlElement String name;
   @XmlIDREF Person director;
}

-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com