Releases: ralfstx/minimal-json
Releases · ralfstx/minimal-json
0.9.5
- New Streaming API: A new abstract base class
JsonHandler
has been introduced to allow processing parser events, e.g. to create arbitrary data structures from a JSON input. When aJsonParser
is instantiated with an instance of a handler, it will issue all events to this handler. - ParseExceptions now provide the location in a
Location
object, containing the fieldsoffset
,line
, andcolumn
. The same type is used byJsonHandler
. - Fixed an issue that could lead to deadlocks during class loading or static fields being
null
. - Since minimal-json is a recursive parser, a stack overflow could occur for very deeply nested JSON inputs. A ParseException is now thrown when the nesting level exceeds 1000.
0.9.4
-
New API entrypoint: The new class
Json
can now be used to parse JSON and to create JSON values. This was done to prevent issues with inheritance (see #52). I hope it also makes the API easier to use and to remember.JsonValue value = Json.parse(string); // replaces JsonValue.readFrom(string) JsonValue name = Json.value("foo"); // replaces JsonValue.valueOf(...) JsonValue count = Json.value(23);
The constants have also moved to Json:
JsonValue checked = Json.TRUE; // replaces JsonValue.TRUE
The old methods and constants are marked as deprecated, but remain available in 0.9.x.
-
New API to create JsonArrays from Java arrays and varargs:
String[] strings = {"foo", "bar"}; JsonArray names = Json.array(strings); JsonArray numbers = Json.array(23, 42);
-
New API to merge JSON objects:
jsonObject.merge(otherObject);
Thanks @phikal.
-
Fixed on Maven. The previous version was broken on Maven Central (#48). This is now fixed.
See the updated README for more details on the API changes.
0.9.3
- Improved writing performance by optimized writing of JSON strings (3ffa39f) and adding a small writing buffer (1c73a6c)
- Lots of improvements to the performance tests, included another parser in comparisons: json-smart
- Support formatted output by an optional parameter to
JsonValue.writeTo()
andtoString()
. Example:
jsonValue.writeTo( writer, WriterConfig.PRETTY_PRINT );
0.9.2
- Switched to MIT License
- Added typed getter methods to JsonObject. These methods accept a default value that is returned if the member does not exist, e.g.
String name = jsonObject.getString("name", "unknown");
int size = jsonObject.getString("size", -1);
0.9.1
First release that is available in Maven Central.
- Added
remove
method onJsonArray