users@jersey.java.net

Re: [Jersey] Change XML property name ?

From: Tatu Saloranta <tsaloranta_at_gmail.com>
Date: Thu, 13 May 2010 09:01:49 -0700

Yes. Please read JAXB documentation or google for the answer. This
should be found from a FAQ; you need to use an annotation (the only
trick is that there are different annotations for collection
properties and other ones).

-+ Tatu +-

On Thu, May 13, 2010 at 2:42 AM, Bruno Cardoso <bcardoso.home_at_gmail.com> wrote:
> Is it possible to change the name of a xml property in my class?
>
> For example
>
> I have class Client that has:
>
>     public List<Account> getAccounts() {
>         return accounts;
>     }
>
> In the xml the name of the property will be:
> <accounts>
>    <id>1</id>
>     ....
> </accounts>
> <accounts>
>    <id>2</id>
>     ....
> </accounts>
>
> but I wanted it to be <account>, I know i can just change the name of the
> method but is there any other way?
>
> Thanks
>