users@jersey.java.net

Re: [Jersey] pojo to json

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 25 Feb 2009 08:30:50 +0100

On Feb 24, 2009, at 11:26 PM, Jakub Podlesak wrote:

>
> Hi Thomas,
>
> Jersey uses StAX for JSON generation from JAXB beans.
> So strictly speaking it is not really Java -> XML -> JSON.
>

Right, to be clear, it is not going from JAXB beans to an XML
document, then parsing that XML document into some in memory model
and converting that in-memory to a JSON document.

Paul.

> Instead Jersey makes JAXB generate StAX events and converts
> the generated events to JSON. The way of processing the StAX events
> varies depending on what JSON notation is selected.
>
> Regarding XML specific overhead, i do not think there
> is anything added here without getting something else in exchange.
> By something else i mean features, which come with JAXB,
> and naturaly also the possibility to easily generate/consume
> two different formats using just one Java model.
>
> I have not done any performace measuring yet, but it is
> definitely something i would like to do in the months to come.
>
> So far, nobody complained, generating JSON from JAXB using Jersey
> does not perform well. But if you have any specific issues
> in this area, i would be happy to help you improve that.
>
> Just let me know, please.
>
> HTH,
>
> ~Jakub
>
>
> On Tue, Feb 24, 2009 at 10:29:57AM -0800, Thomas Amsler wrote:
>> Is Jersey (JAX-RS) doing a direct POJO to JSON conversion using JAXB
>> annotations or does it do a POJO --> XML --> JSON conversion? If
>> it is
>> doing a POJO --> XMl --> JSON conversion, what is the XML specific
>> conversion overhead.
>> Best,
>> -- Thomas
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>