users@jaxb.java.net

Re: Finding implementation class from FieldOutline?

From: Colin Fleming <colin.mailinglist_at_gmail.com>
Date: Tue, 16 Dec 2008 18:17:31 +0100

Ok, looking at the JAXB source code, it looks like the sequence is: From my
FieldInfo, get the CPropertyInfo. Cast that to a CElementPropertyInfo. On
that, call getTypes(), and (I assume) get the first element assuming it only
has one. I then call getTarget() and cast that to a CClassInfo. From there I
can get the user specified type.

That seems kind of horrible, and there are a bunch of failure points there
that I don't understand. Does getTypes() always return one element? What
does it really represent? What if getTarget() isn't a CClassInfo?

It's pretty nasty - is there really no better way to do this?

Cheers,
Colin