You'll have to create a class Occupation and use this in Person.
-W
On 7/20/09, Vladimir Blagojevic <dovlex_at_gmail.com> wrote:
>
> Hi,
>
> I would like to map a class with a fairly flat structure (fields are either
> primitives or String) to a xml structure that is not so flat. Let me
> explain. Say there is a Person class:
>
> public class Person {
>
> String name;
> int age;
> String occupation;
> String occupationPosition;
> String streetAddress;
> String cityAddress;
> ....
>
>
> I would like to group occupation related string fields into <occupation>
> element with two attributes say type and position and in a similar fashion
> address related string fields into <address> element.
>
> Any ideas how to achieve this type of mapping?
>
> Best regards,
> Vladimir
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>