users@jaxb.java.net

Re: cannot adapt an XmlRootElement ?

From: Kohsuke Kawaguchi <kohsuke.kawaguchi_at_sun.com>
Date: Sat, 14 Jan 2006 08:02:05 +0900

Mark Hansen wrote:
> Given the above, when you marshal an instance of MyFoo, it should
> produce the XML that is mapped from Foo. But, the Sun RI does not work
> like this. It seems to ignore the adapter. It seems that this behavior
> is consistent with the specification - since there is not "point of
> reference" for MyFoo in the actual class definition of MyFoo. However,
> the upshot is that you can't marshal a boutn type to a global element.
> That seems like a common use case that JAXB 2.0 should handle.
>
> Pleasse let me know if I am missing something.

You can just invoke the adapter by yourself and hand the result to the
marshaller, since it's the root of the object.


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com