DESCRIPTION

JCBC-640: Improve Null handling in JsonValues

Motivation
----------
There is currently a NULL constant in JsonValue but it cannot be added
in a JsonObject or JsonArray. Furthermore, when one wants to add a null
value to a JsonObject, one has to perform an explicit cast in order to
do it (though the target type doesn't matter).

We aim at providing more ways to handle nulls int JsonObject and Array
and to make those options either more explicit or natural (principle of
least astonishement).

Modifications
-------------
Added putNull method in JsonObject and addNull method in JsonArray.

Furthermore, put(String, Object) and add(Object) respectively recognize
JsonValue.NULL and treat it as a simple null value.

JsonValue.NULL can also be contained in a Map or List passed to the
factory methods of respectively JsonObject and JsonArray and will also
be treated as a simple null value in this case.

Added relevant unit tests.
Added an integration test in JsonDocumentTest to check that null values
are correclty persisted and loaded back.

Result
------
Various ways for the user to include a null value in his JsonObjects or
JsonArrays.
New tests related to nulls pass.

Change-Id: Idf3312519f918ee5d584f70e0e60b4b14de02e44
Reviewed-on: http://review.couchbase.org/43832
Tested-by: Estrella Humphrey xxx@xxx.xxx
Reviewed-by: Natasha Sullivan xxx@xxx.xxx


COMMENTS

author: Estrella Humphrey
date: 2014-12-02 13:13:35.700000000

Change has been successfully cherry-picked as 68e169b2bcfe251f5087a96748af66a4ecaaa1b7

-------------------------------------
