users@jaxb.java.net

Re: jaxb1 problem with complex-types vs elements

From: Ed Mooney <Ed.Mooney_at_Sun.COM>
Date: Mon, 26 Jun 2006 21:02:39 -0400

Hi Christoph,

I'm sorry, but I don't follow. The test case you provided builds up a
content tree that's invalid with respect to the original schema, causing
the exception you reported. This is allowed by the spec and up to the
programmer to avoid. It has nothing to do with the inheritance model.

Regards,
-- 
Ed Mooney         |Sun Microsystems, Inc.|Time flies like
Java Web Services |UBUR02-201            |an arrow, but
Ed.Mooney_at_Sun.COM |1 Network Drive       |fruit flies like
781-442-0459      |Burlington, MA  01803 |a banana. Groucho
Christoph Sturm wrote:
> Hey Ed!
> 
> My only issue with this behavior is this:
> 
> <element name="x" type="y"/> generates code like this:
> 
> class X extends Y
> 
> and thus every setter that takes an argument of Y can als be invoked
> with an instance of type X. And there goes my typesafety.
> 
> If X would not extend Y everything would be fine, and i would get a
> compiler error.
> 
> do you understand my issue?
> 
> regards
> chris
[ ... ]