users@jaxb.java.net

Re: Interesting annotations mapping problem

From: Vladimir Blagojevic <dovlex_at_gmail.com>
Date: Tue, 21 Jul 2009 13:56:22 +0200

Wolfgang,

I appreciate it! I bypassed this problem by creating all of these minor
container classes next to Person.

Regards,
Vladimir

On 7/21/09 8:02 AM, Wolfgang Laun wrote:
> You'll have to create a class Occupation and use this in Person.
> -W
>
> On 7/20/09, *Vladimir Blagojevic* <dovlex_at_gmail.com
> <mailto: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
> <mailto:users-unsubscribe_at_jaxb.dev.java.net>
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
> <mailto:users-help_at_jaxb.dev.java.net>
>
>