users@jaxb.java.net

Re: Set methods for collections

From: Kohsuke Kawaguchi <kohsuke.kawaguchi_at_sun.com>
Date: Wed, 08 Feb 2006 22:10:47 -0800

Aleksei Valikov wrote:
> Hi.
>
>> I will have a look at the accessor classes, thanks for the pointer.
>> I am ultimately interested in generating the hibernate binding files from
>> either the xsd files or the generated classes. I had some initial luck
>> creating simple binding files for classes, but I soon realized that I could
>> not deduce what classes are actually stored when the property accepts more
>> then a single value ( minOccurs="0" maxOccurs="unbounded"), this is a sort
>> coming of Java's introspection.
>
> You can find that out from JAXB's internal models. In JAXB 1, you could
> check types of the FieldItem.

Yes. I hope JAXB 2's internal model is lot more accessible to the
uninitiated than that of JAXB 1.

In 2.0, a Plugin gets access to Model, and this is the root of the
blueprint of the generated code. From here, you can go down to
CClassInfo, then to CElementPropertyInfo, and it tells you exactly what
can be in this property, and whether it's a collection or not, etc, etc.

As a plugin, you also get Outline, and this can take you from Model to
CodeModel concepts.

>> I will take a look at hyperjaxb2 and the information about plug-ins and let
>> you all know if I decide to make a new plug-in, help update hyperjaxb2, or
>> just create the binding files by hand :)
>
> Ok. I think I've already installed the hyperjaxb3 project on
> dev.java.net some time ago. Feel free to join that.

Ah, so the version of hyperjaxb that works with JAXB 2.0 is called
hyperjaxb3?

... Oh wait, I'm not seeing it. ???

-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com