I have not investigated this, yet, but I am experiencing out of memory errors when serializing a larger array (35000) of beans to json. The beans are not complex and the jvm is configured with plenty of memory. Have you experienced anything like that or know of any memory leaks that you fixed recently (as you made changes to the serializer as discussed below)? I am still on the Jazz version of Juno and wanted to check if this was something you already encountered before I dive into it (or work around it by paging the serialization).
Thanks a lot and best regards,
James Bognar ---03/09/2017 06:35:29 PM---Update.... I'm close to delivering this.
From: James Bognar <email@example.com>
Date: 03/09/2017 06:35 PM
Subject: Re: Adding builder classes for serializers and parsers.
I'm close to delivering this.
Here's what it will look like to create a new serializer:
JsonSerializer n = new JsonSerializerBuilder(s)
Shortcut methods are provided for common builder setters.
This is an equivalent to the above:
JsonSerializer n = new JsonSerializerBuilder(s).sq().ws().build();
To clone, a builder() method has been added to serializers and parsers:
JsonSerializer n = JsonSerializer.DEFAULT.builder().sq().ws().build();
I've introduced RestClientBuilder, SerializerGroupBuilder, and
ParserGroupBuilder classes as well.
On Fri, Mar 3, 2017 at 2:02 PM, James Bognar <firstname.lastname@example.org>
> > Would the builder be able to take a parameter? So to clone the
> serializer s but change the UseWhitespace setting:
> Yea...I can include that.
> You'll also be able to specify a subclass in the build method...
> JsonSerializer n = new JsonSerializerBuilder().useWhitespace(false).build(
> On Fri, Mar 3, 2017 at 1:20 PM, Craig Russell <email@example.com>
>> From left field…
>> > On Mar 3, 2017, at 5:14 AM, James Bognar <firstname.lastname@example.org>
>> > Hi all,
>> > I'm thinking about changing the way serializers and parsers are
>> > by creating builder classes. I wanted to run it by the team first
>> > Creating a custom serializer would look like this...
>> > JsonSerializer s = new
>> > JsonSerializerBuilder().useWhitespace(true).trimNulls(true).build();
>> I like this pattern. I’m not a huge fan of setXXX when xxx is a perfectly
>> good understandable concept
>> > ...instead of...
>> > JsonSerializer s = new
>> > JsonSerializer().setUseWhitespace(true).setTrimNulls(true).lock();
>> > With this approach I can make the fields final and eliminate the
>> > locks from the classes.
>> > The DEFAULT serializers and parsers are not going away. You won't be
>> > to clone and modify them anymore though.
>> > Any thoughts?
>> Would the builder be able to take a parameter? So to clone the serializer
>> s but change the UseWhitespace setting:
>> JsonSerializer n = new
>> Craig L Russell
> James Bognar