users@jaxb.java.net

2.1.8 issue

From: Claus Nagel <claus.nagel_at_gmail.com>
Date: Wed, 3 Sep 2008 12:09:31 +0200

Hi all -

I just updated to JAXB RI 2.1.8 and re-compiled my schema using xjc. The
resulting Java classes are different to a great extent. Have a look at the
following class snippets:

JAXB 2.1.7:
> public abstract class AbstractGMLType {
> protected List<MetaDataPropertyType> metaDataProperty;
> protected StringOrRefType description;

JAXB 2.1.8:
> public abstract class AbstractGMLType {
> @XmlElementRef(name = "metaDataProperty", namespace =
"http://www.opengis.net/gml", type = MetaDataPropertyElement.class)
> protected List<MetaDataPropertyElement> metaDataProperty;
> @XmlElementRef(name = "description", namespace =
"http://www.opengis.net/gml", type = DescriptionElement.class)
> protected DescriptionElement description;


I have a jaxb:bindings file where I set "generateElementClass" to "true" and
element classes are marked using the suffix "Element".

As you can see from the code snippets, for JAXB 2.1.7, the data type of the
generated instance variables refers to the class representing the xsd
complex type definition. For JAXB 2.1.8, the data type is the generated
element class (well, however, also JAXB 2.1.8 sometimes uses the classes
representing the type definition as data type...)

I did not change my binding rules. This behaviour of JAXB 2.1.8 is quite
annoying since my whole project does not compile any more due to the
differing data types.

Any ideas, how I can tell JAXB 2.1.8 not to use the element classes as data
types?

Regards,
Claus