users@jaxb.java.net

Re: JAXB customization to generate flat (less hierarchal) Java class

From: Felipe Gaucho <fgaucho_at_gmail.com>
Date: Thu, 23 Apr 2009 09:57:17 +0200

Fan you usw a superclass?


Sent from my iPhone

On 23.04.2009, at 09:33, dhai <sdhari_at_hotmail.com> wrote:

>
> <xs:element name="car">
> <xs:element name="engine">
> <xs:element name="engineNumber" type="xs:string"/>
> <xs:element name="enginePower" type="xs:float"/>
> </xs:element>
> <xs:element name="body">
> <xs:element name="colour" type="xs:string"/>
> <xs:element name="length" type="xs:float"/>
> </xs:element>
> </xs:element>
>
> JAXB compiler creates following three classes for the above schema.
>
> class Car{
> protected Engine engine;
> protected body body;
> }
> class Engine{
> protected String engineNumber;
> protected float eninerPower;
> }
> class Body{
> protected String colour;
> protected float length;
> }
>
> I need a flat bean to access all the attribute from a single class.
> I need
> JAXB to generate the following class. I don’t have option to change
> xsd and
> upcoming xml request. Of course I don’t just want class generation b
> ut also
> want marshalling/unmarshalling work successfully.
>
> class car{
> protected String engineNumber;
> protected float eninerPower;
> protected String colour;
> protected float length;
> }
> --
> View this message in context: http://www.nabble.com/JAXB-customization-to-generate-flat-%28less-hierarchal%29-Java-class-tp23191755p23191755.html
> Sent from the java.net - jaxb users mailing list archive at
> Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>