You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jaxme-dev@ws.apache.org by Colin Bendell <cb...@point2.com> on 2004/02/02 23:51:55 UTC

ObjectFactory weirdness

I have encountered a few issues with the generation of the ObjectFactory
in the JAXB implementation in JAXME2.  I've attached the XSD that I am
using for testing.  In this example, I have global elements and global
complex types.  Some of the global elements are instances of global
complex types.  What I have noticed is that the ObjectFactory only has
create methods for the Types (complex types).  For example, if I have a
global element 'Toys' which has an implicit complex type which has
several simple elements, the ObjectFactory will have a method named
createToysType, but no method called createToys.

Furthermore, if I have several elements that are implementations of a
global complex type, the ObjectFactory incorrectly generates multiple
entries for the complex type.  For example, if I have a global type
called 'Food' and two elements which implement food 'Vegetables' and
'Fruit', the result in the factory are two methods called
createFoodType.

Both of these cases work as I expect against the JAXB reference impl.  

I've attached a patch that will correctly add the create methods for the
global elements, global types and any implicit global types.  

Cheers
/colin

 <<test.xsd>> 

Re: ObjectFactory weirdness

Posted by Jochen Wiedmann <jo...@ispsoft.de>.
Hi, Colin,

Colin Bendell wrote:

> I have encountered a few issues with the generation of the ObjectFactory
> in the JAXB implementation in JAXME2.  I've attached the XSD that I am
> using for testing.  In this example, I have global elements and global
> complex types.  Some of the global elements are instances of global
> complex types.  What I have noticed is that the ObjectFactory only has
> create methods for the Types (complex types).  For example, if I have a
> global element 'Toys' which has an implicit complex type which has
> several simple elements, the ObjectFactory will have a method named
> createToysType, but no method called createToys.

I know that this problem has been in 0.2, but afaik it has been fixed
in version 1.4 of JAXBSchemaSG?


> Furthermore, if I have several elements that are implementations of a
> global complex type, the ObjectFactory incorrectly generates multiple
> entries for the complex type.  For example, if I have a global type
> called 'Food' and two elements which implement food 'Vegetables' and
> 'Fruit', the result in the factory are two methods called
> createFoodType.
> 
> Both of these cases work as I expect against the JAXB reference impl.  
> 
> I've attached a patch that will correctly add the create methods for the
> global elements, global types and any implicit global types.  

A question: Do you see any reason, why the getFooType() methods should
be present at all? That they have been in the factory was a bug and I
see no reason to continue that part.


Regards,

Jochen

---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org