Skip to content

Releases: ralfstx/minimal-json

0.9.5

09 Dec 21:06
0.9.5
Compare
Choose a tag to compare
  • 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 a JsonParser 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 fields offset, line, and column. The same type is used by JsonHandler.
  • 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

19 Jul 19:52
Compare
Choose a tag to compare
  • 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

15 May 20:03
Compare
Choose a tag to compare
  • 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() and toString(). Example:
jsonValue.writeTo( writer, WriterConfig.PRETTY_PRINT );

0.9.2

30 Dec 22:44
Compare
Choose a tag to compare
  • 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

25 Nov 19:54
Compare
Choose a tag to compare

First release that is available in Maven Central.

  • Added remove method on JsonArray

0.9.0

10 Oct 15:32
Compare
Choose a tag to compare

First release.
Good stability and performance.
API may still change slightly until 1.0.