users@jsonb-spec.java.net

[jsonb-spec users] [jsr367-experts] Re: Re: Re: Re: Re: Re: Re: JSONB De/Serializers proposal

From: Eugen Cepoi <cepoi.eugen_at_gmail.com>
Date: Mon, 9 May 2016 15:21:01 -0700

Romain,

2016-05-09 14:24 GMT-07:00 Romain Manni-Bucau <rmannibucau_at_tomitribe.com>:

>
> If i want to read attribute foo then bar but stream has the opposite jsonb
> can ensure it works, jsonp parser cant. Also testing if a key is there is
> harder than it should with this solution.
>

What you want is a dom representation, just do
context.deserialize(JsonObject.class, parser) it should achieve the same
result as JsonReader.
JsonReader/Writer are just helpers IMO that have been added because there
was no binding layer.

Class should be first user API there and Type first jsonb runtime api to
> avoid to move advanced reflection need to user land IMO.
>
Do you mean have a method for Type and another for Class? Class is a
subclass of type, you can pass without dealing with anything nasty :)
Of course if one has a generic type then he can use TypeToken from guava or
one of the other 100 existing versions ^^