users@jersey.java.net

[Jersey] Converter list problem

From: Gautam Arora <gautamsarora_at_gatech.edu>
Date: Fri, 13 Mar 2009 19:22:30 -0700 (PDT)

Hi,
I have a Converter structure similar to....

@XmlRootElement(name = "things")
public class MyThingsConverter {
    private Collection<MyThing> entities;
    private Collection<MyThingConverter> items;
.....
}

@XmlRootElement(name = "thing")
public class MyThingConverter {
    private MyThing entity;
...
}

now when i get a response using MyThingsConverter (by returning an object of
it), my response looks like:
<things>
    <MyThing>
    ....
    </MyThing>
</things>

whereas I am expecting it to be:
<things>
    <thing>
    ....
    </thing>
</things>

so it seems that the MyThingsConverter is not properly picking up the
correct XmlRootElement for thing which is defined by me as thing and going
with the default class name of MyThing.

When I just try to get a reponse from MyThingConverter, I get
<thing>
...
</thing>

So, the problem seems to be when MyThingsConverter contains a list
MyThingConverter.

Any flag/setting that I need to enable in such a case?

Thanks,
Gautam
-- 
View this message in context: http://n2.nabble.com/Converter-list-problem-tp2476841p2476841.html
Sent from the Jersey mailing list archive at Nabble.com.