users@jsonb-spec.java.net

[jsonb-spec users] [jsr367-experts] Re: [2-DefaultMapping] Proposal

From: Eugen Cepoi <cepoi.eugen_at_gmail.com>
Date: Fri, 13 Mar 2015 18:56:46 +0100

2015-03-13 18:43 GMT+01:00 Inderjeet Singh <inder_at_alumni.stanford.edu>:

> I think fromJson(File) is unnecessary and should be removed.
> Even fromJson(InputStream) is supect, but I guess InputStreams are still
> all too common.
>
>
I think it is good to keep InputStream, most of the time we deal with
inputstream or byte arrays.


> toJson(..., Appendable appendable) should be better than Writer().
>

Hum, writer allows to write array of chars, obtaining a charsequence from
an array of chars would degrade impls don't you agree?


> Get rid of toJson(..., writer), toJson(..., File) and toJson(...,
> OutputStream)
>

File I don't care, but disagree for OS.


>
> A powerful (and very useful) feature of Gson is custom type adapters. How
> will that be done in Jsonb.
>

I guess it will be achieved via a similar mechanism as the type adapters in
JAXB?


>
> Inder
>
>
>
>
>
> On Thu, Mar 12, 2015 at 9:36 AM, Eugen Cepoi <cepoi.eugen_at_gmail.com>
> wrote:
>
>> Hey Martins,
>>
>> Quick feedback on the API.
>>
>> I don't like much the to/from in JsonbConfig. At least for the formatting
>> it is obvious that it exists only during serialization.
>> Not sure ConfigException is needed, I mean sure in some case we could
>> throw this exception, but in practice maybe no one will. Also in multiple
>> places I see IllegalArgumentEx, and it makes sense, we could same way use
>> other existing exceptions - instead of ConfigEx.
>>
>> getProperty could return an Optional and throw an exception only if the
>> arg is null.
>>
>> We could also add an option to skip null during serialization in the
>> config.
>>
>> In JsonbBuilder, the newBuilder related to JsonbProvider are a bit
>> redundant as we also have similar method inside the provider. But from
>> another side, it provides a single entry point - this is good. This makes
>> the API more easy to use.
>>
>> I didn't read the javadoc carefully.
>>
>> About the examples... well they are just examples :)
>>
>> Eugen
>>
>>
>> 2015-03-12 16:46 GMT+01:00 Martin Grebac <martin.grebac_at_oracle.com>:
>>
>>> Just would like to explicitly point to the spec document itself in this
>>> branch:
>>>
>>> https://java.net/projects/jsonb-spec/sources/git/
>>> content/spec/spec.pdf?rev=da7db533076856699cec49a4eebd300b9f4a7230
>>>
>>> MartiNG
>>>
>>>
>>> On 12.03.15 16:35, Martin Vojtek wrote:
>>>
>>>> Hi Experts,
>>>>
>>>> there has been a lot of changes recently in default_mapping. This
>>>> completes the second iteration of default mapping proposal.
>>>>
>>>> Generics and integration with JSON Processing is not part of this
>>>> discussion.
>>>>
>>>> Please take a look and feel free to express your point of view.
>>>>
>>>> https://github.com/json-binding/spec/tree/default_mapping
>>>>
>>>> Looking forward to your feedback.
>>>>
>>>> MartinV
>>>>
>>>
>>>
>>
>