juneau-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Bognar <jamesbog...@apache.org>
Subject Adding builder classes for serializers and parsers.
Date Fri, 03 Mar 2017 13:14:20 GMT
Hi all,

I'm thinking about changing the way serializers and parsers are constructed
by creating builder classes.  I wanted to run it by the team first though.

Creating a custom serializer would look like this...

JsonSerializer s = new
JsonSerializerBuilder().useWhitespace(true).trimNulls(true).build();
...instead of...
JsonSerializer s = new
JsonSerializer().setUseWhitespace(true).setTrimNulls(true).lock();

With this approach I can make the fields final and eliminate the read-write
locks from the classes.

The DEFAULT serializers and parsers are not going away.  You won't be able
to clone and modify them anymore though.

Any thoughts?

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