users@jersey.java.net

Re: [Jersey] pojo to json

From: Jakub Podlesak <Jakub.Podlesak_at_Sun.COM>
Date: Tue, 24 Feb 2009 23:26:31 +0100

Hi Thomas,

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

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
>