JSON 4 Java 1.3
JSON 4 Java is a simple JSON library for Java.
Changelog
New methods in
JsonObject
to avoid usingJsonValue
classes:getObject
,getArray
,getBoolean
,getNumber
andgetString
putBoolean
,putNumber
,putString
New methods in
JsonArray
for the same reason asJsonObject
:getObject
,getArray
,getBoolean
,getNumber
andgetString
addBoolean
,addNumber
,addString
(with and without theindex
argument)JsonBoolean
andJsonNumber
constructors now take primitive types (boolean
anddouble
resp.) instead of wrapper types (Boolean
andDouble
resp.)
JsonObject.getAs()
: if a key has no mapping, the method will throw an exception instead of returning null to avoid confusion with an actual null JSON value.JSON entities now have a
getTypeName()
method that returns the name of the corresponding JSON type.JsonEntityType
instances have this method too.
Control characters are now handled accordingly to the official specifications
Fixed escaped solidus ('/')
JSON parser
JSON writer
Java types for each JSON type