users@jaxb.java.net

Re: Abstract Types and Separate Compilation Times

From: Jamie Johnson <jej2003_at_gmail.com>
Date: Tue, 10 Feb 2009 08:10:51 -0500

Compiling AbstractBase.xsd and Root.xsd together builds this:
    @XmlElement(name = "AbstractBase", namespace = "
http://test.com/AbstractBase.xsd")
    protected List<AbstractType> abstractBase;

Compiling all three together builds this:
    @XmlElementRef(name = "AbstractBase", namespace = "
http://test.com/AbstractBase.xsd", type = JAXBElement.class)
    protected List<JAXBElement<? extends AbstractType>> abstractBase;

The second result makes the result unusable as I can't do any substitutions.

On Tue, Feb 10, 2009 at 1:56 AM, Wolfgang Laun <wolfgang.laun_at_gmail.com>wrote:

> I cannot confirm that extending a complex type with abstract="true", either
> within the same schema or in a second schema imprting the first one, is
> sufficient to trigger the inclusion of the JAXBElement wrapper. Could you
> please post the (reduced) schema code?
>
> Wolfgang
>
>
> On Mon, Feb 9, 2009 at 6:47 PM, Jamie Johnson <jej2003_at_gmail.com> wrote:
>
>> I am running into an issue where I have created several XSDs, xsd 1 has an
>> abstract type defined, xsd 2 implements the xsd (it is important to note
>> that xsd 1 has no implementations of the abstract type). If I compile these
>> schemas together I get the expected result in that the Java created has a
>> method of the form.
>>
>> setGeometry(JAXBElement<? extends GeometryBaseType>)
>>
>> but if I compile them separately the method looks like
>>
>> setGeometry(GeometryBaseType)
>>
>> which does not allow me to properly use the object generated in xsd 2.
>> Short of compiling everything together, how can I have this method generated
>> appropriately?
>>
>
>