Argo

A lightweight j(a)son library.

MIT License

Stars
2

Bot releases are hidden (Show)

Argo - String Escaping Latest Release

Published by Moderocky over 2 years ago

This release handles escaping and un-escaping strings.

Full Changelog: https://github.com/Moderocky/Argo/compare/1.1.1...1.1.4

Argo - Direct Array Creation

Published by Moderocky over 2 years ago

This release allows arrays to be converted directly, rather than via objects.
It also supports converting single-type json arrays.

final int[] result = Json.fromJson("[1, 2, 3]", new int[0]);

If arrays have a specified size they will trim any additional data.

final int[] result = Json.fromJson("[1, 8, 3, 6, 7]", new int[2]);
assert result.length == 2;

This also works with objects of complex type, which will be converted.

final MyClass[] result = Json.fromJson("[ {...}, {...} ]", new MyClass[0]);

Full Changelog: https://github.com/Moderocky/Argo/compare/1.1.0...1.1.1

Argo - Object Conversion

Published by Moderocky over 2 years ago

This release contains an object <-> json conversion system.
This is designed for accessing the json data more easily, rather than for serialisation.

final String data = // { "a": 1, "b": 6, "hello": "there" }

class Result { int a, b; String hello; }

final Result result = Json.fromJson(data, new Result());

assert result.a == 1;
assert result.b == 6;
assert result.hello.equals("there");

result.a++;

final String string = Json.toJson(result);
// string = { "a": 2, "b": 6, "hello": "there" }

Full Changelog: https://github.com/Moderocky/Argo/compare/1.0.0...1.1.0

Argo - Initial Release

Published by Moderocky over 2 years ago