users@jaxb.java.net

Re: dealing with an element that isn't in your java objects?

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Wed, 06 Dec 2006 15:38:54 -0800

Jamie wrote:
> I was sad to see that I couldn't accomplish this with an inner class
> (due to the inherent constructor that inner classes get). Can you
> explain a little more what you are suggesting re: a separate class and
> an adapter?

I think there's some example bundled in the JAXB RI that shows you how
to write an adapter.

Allowing inner classes to be used in some limited ways would be a nice
feature. Could you file that as an RFE?

The only problem with inner class is to find the outer class instance to
associate it to, and for the most case this is a non-issue because
people use the inner class as a child element of the outer class (and
thus there's an obvious outer class instance.)

I wonder if we can take advantage of that in JAXB.

-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com