Customizing generaetd classes
> Hi;
> I read the jaxb user guide and I feel like an important part is missing(or
> maybe not supported by JAXB). Browsing the spec did not help also.
>
> A lot of people in the J2EE community are waiting to use JAXB in the
> context of Value Objects in order to Tranfer small chunks of data between
> tiers.
> In the presentation tier we would like to have those VO transformed into
> XML.
> Specifically, In my project we have huge huge xml schemas and would like
> to generate classes from each schema that represent a small fragment of
> the schema. We are waiting for JAXB usage anxiouslly but could not
> understand how the achieve the following:
>
> For example; We would like the schema:
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="qualified">
> <xs:element name="a">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="b" type="xs:string"/>
> <xs:element name="c" type="xs:string"/>
> <xs:element name="d" type="xs:string"/>
> <xs:element name="e">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="f"
> type="xs:string"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
>
>
> To be generated into:
> Interface <someIfc>{
> public string getB();
> public void setB(String b);
> }
> and
> Class <someName> implements <someIfc>{
> String b;
> public string getB(){return b;}
> public void setB(String b){this.b=b;}
> }
>
> Discurding most of the schema content in the generated classes. Yet when
> transforming an instance of that class into XML we would like it to
> transfrom according to the full scema.
>
> For example:
> An instance of class <someName> with string value of b set to "b" will be
> transformed into:
> <a>
> <b>b</b>
> <c/>
> <d/>
> <e>
> <f/>
> </e>
> </a>
>
> Or something like that.
>
> I figured this would be done by custom bindings but could not find the way
> to do this in the user guide.(maybe I didn’t understand the guide very
> well)
> Is JAXB an apprepriate technology for this? I could not get this from the
> manual.
> I would really appreciate a respose even though this is just a comments
> mail address
> Thanks.
>
>
>
> _______________________
> Guy Katz
> Comverse
> guy.katz_at_comverse.com
> +972 3 7663686
>