JSON 4 Java 1.3
JSON 4 Java is a simple JSON library for Java.
Changelog
New methods in
JsonObjectto avoid usingJsonValueclasses:getObject,getArray,getBoolean,getNumberandgetStringputBoolean,putNumber,putStringNew methods in
JsonArrayfor the same reason asJsonObject:getObject,getArray,getBoolean,getNumberandgetStringaddBoolean,addNumber,addString(with and without theindexargument)JsonBooleanandJsonNumberconstructors now take primitive types (booleananddoubleresp.) instead of wrapper types (BooleanandDoubleresp.)
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.JsonEntityTypeinstances 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