users@jaxb.java.net

Re: JAXB - Automatic creation of mandatory children

From: Aleksei Valikov <valikov_at_gmx.net>
Date: Tue, 21 Sep 2004 11:06:15 +0200

Hi.

> I have a web-based application to edit an XML file. I
> am using JAXB to convert my XML file to Java objects.
>
> I am facing a problem. Whenever I want to create a new
> element, I am also forced to create all the mandatory
> child elements and set them in the object for the new
> element.

Could you please elaborate on why are you forced to create all mandatory
children.

> This becomes a real pain since the number of elements
> I create and the number of mandatory children each
> element has is really huge, I am writing a lot of code
> for creating and setting these objects.
>
> Is there a way in JAXB that creates all these
> mandatory children automatically whenever I create the
> parent object.

Any idea how JAXB could guess the values for the mandatory children?

> I assume this has got to do with the way the classes
> are generated. At present, there is no such code
> generated for creating mandatory children.
>
> Please let me know if this can be done by any means.

Try disabling the validation.

Bye.
/lexi

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net