juneau-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Bognar <jamesbog...@gmail.com>
Subject Re: javax.json support
Date Sun, 04 Jun 2017 13:56:52 GMT
Is this JSR still alive?  Several of the links on the page are dead.

Some notes:

It's working with purely unstructured data, similar to JSON4J with
JSONObject and JSONArray objects.  This is similar to using Juneau with
ObjectMaps and ObjectLists.

The Object Model API is a DOM for JSON.  While you CAN accomplish the same
thing in Juneau using ObjectMap/ObjectList, one of the best features in
Juneau is that you don't NEED to construct a model.  You can marshall
directly against in-memory POJOs.

The JSR works with objects of type
JsonValue/JsonObject/JsonArray/JsonString/JsonNumber.  JsonObject/JsonArray
have ObjectMap/ObjectList equivalents, but for the others we simply
marshall against Java Numbers and Strings which is more efficent.

The streaming API is interesting.  Juneau currently doesn't have streaming
and event-driven support.

Takeaway:

If it's still alive, we could create a JsonReader/JsonWriter implementation
based on Juneau.  Some layer would have to be added to convert
ObjectMap/ObjectList/... to and from JsonObject/JsonArray/....
That would be pretty easy to implement.

If A more-efficient approach would be to alter the
JsonSerializer/JsonParser to support marshalling directly to and from
JsonObject/JsonArray objects.  That's a bit more difficult, but not
impossible.



On Sun, Jun 4, 2017 at 9:32 AM, John D. Ament <johndament@apache.org> wrote:

> So I finally started digging into this.  I'm a bit lost, but its mostly
> because of my poor understanding of how javax.json is meant to work.
>
> http://www.oracle.com/technetwork/articles/java/json-1973242.html
>
> I think what I want to do is create a "JuneauJsonReader" that implements
> "javax.json.JsonReader" which delegates down to Juneau's JsonParser.  The
> struggle is how to translate a JsonObject, which is just a map of
> JsonValues.
>
> Thoughts for a newbie?
>
> John
>
> On Sat, Mar 25, 2017 at 10:33 PM James Bognar <james.bognar@salesforce.com
> >
> wrote:
>
> > On Sat, Mar 25, 2017 at 10:11 PM John D. Ament <johndament@apache.org>
> > wrote:
> >
> > > Hey guys
> > >
> > > Just wondering, would there be interest in pursuing a wrapper layer
> over
> > > Juneau as an implementation of JSR-353, JSON-P https://jsonp.java.net/
> ?
> > >
> > > Obviously we couldn't say that we pass the TCK, due to licensing
> issues,
> > > but I think it would overall be a huge step in the direction of
> adoption
> > if
> > > we can implement these interfaces within Juneau.  And then, if we're on
> > the
> > > subject, adding support for JSON-B (
> > > https://java.net/projects/jsonb-spec/pages/Home )
> > >
> > > (And of course, I expect a following email from James indicating that
> he
> > > already has it, and I missed it.. :-)
> > >
> > > John
> > >
> >
> > Nope...not implemented yet :-p
> >
> > I looked briefly at JSON-B when I added MessagePack support (which is
> very
> > similar).  IIRC, the difficulty with JSON-B was that you needed to know
> the
> > data sizes of the children before serialization which isn't easy doing
> when
> > you're trying to do everything in a single pass of the data structure
> > without a DOM.
> >
> > JSONP is interesting and Nick and Min wanted me to add that support years
> > ago but I never got around to it. (and they left their project at IBM so
> > nobody else was asking for it)
> >
> > I'm probably going to be busy for a while working on the proxy interface
> > support with the Streams team, so anyone wishing to work on either,
> please
> > feel free to step up!
> >
> >
> >
> >
> > --
> > James Bognar
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message