users@jersey.java.net

Re: [Jersey] Question on JAXB JSON Marshalling

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Fri, 06 Feb 2009 15:08:40 +0100

On Feb 6, 2009, at 2:42 PM, Farrukh Najmi wrote:

> Paul Sandoz wrote:
>>
>> On Feb 6, 2009, at 1:19 AM, Jakub Podlesak wrote:
>>
>>>
>>> Hi Farrukh,
>>>
>>> We wanted to produce the JSON documents to be as simple
>>> as possible for clients
>>
>> I would add specifically JavaScript clients (even though the JSON
>> format may be more appealing as a data-format than say XML).
>>
>>> to consume.
>>
>> Right, that is the main point of JSON, which is why i think more
>> literal mappings like BadgerFish miss the point, one might as well
>> use XML and E4X.
>>
>> The problem that is really hard to juggle is that different users
>> have different expectations on how they want the XML infoset
>> produced by JAXB to be mapped to JSON. Which is why we have tried
>> to offer different notations to meet that need.
>>
>> What i think we need is some good clear documentation on the
>> "NATURAL" convention we have just introduced so that users can
>> decide whether that is appropriate for them or not. And we should
>> avoid mentioning XSD in such documentation :-)
>>
>
> Thank you Jakub and Paul for your help. At present I am stuck with
> older JAXB due to some unresolved versioning compatibility issues in
> my stack. This means I cannot use the NATURAL notation yet. Perhaps
> this will change soon with release of JAXB and aligned releases of
> higher level dependencies. I will send an update when I try the
> latest JAXB and NATURAL notation. Where is the docs on al the
> different notations and their details? Thanks.
>

See:

   http://download.java.net/maven/2/com/sun/jersey/jersey-json/1.0.2-SNAPSHOT/jersey-json-1.0.2-SNAPSHOT-javadoc.jar

Note that i just made some tweaks in terms of building configuration
in the trunk, but apart from that the JavaDoc is accurate.

Paul.