users@jersey.java.net

[Jersey] Re: how to rename XmlRootElement in JSON

From: Maxrunner <joao.rossa_at_gmail.com>
Date: Tue, 31 May 2011 03:29:51 -0700 (PDT)

Forgot to thank to tatu as well i ended up using his map extending class
implementation:

"Or, if you want fully dynamic name
just use Map&lt;String, List&lt;MyType&gt;> by sub-classing:

public class ListWrapperWithMap extends HashMap&lt;String,
List&lt;ActualType&gt;> {
  public ListWrapperWithMap(String rootName, List<ActualType> value) {
    this.put(rootName, value);
  }
}

and then:

return new ListWrapperWithMap("rootName", listValue); "

So thank you to both :)

regards,

P.S:any idea when the final 1.8 version is released?




--
View this message in context: http://jersey.576304.n2.nabble.com/how-to-rename-XmlRootElement-in-JSON-tp6173292p6422167.html
Sent from the Jersey mailing list archive at Nabble.com.