jo-json

A small JSON library.

License

License

Categories

Categories

JSON Data
GroupId

GroupId

se.llbit
ArtifactId

ArtifactId

jo-json
Last Version

Last Version

1.3.1
Release Date

Release Date

Type

Type

jar
Description

Description

jo-json
A small JSON library.
Project URL

Project URL

https://github.com/llbit/jo-json
Source Code Management

Source Code Management

https://github.com/llbit/jo-json

Download jo-json

How to add to project

<!-- https://jarcasting.com/artifacts/se.llbit/jo-json/ -->
<dependency>
    <groupId>se.llbit</groupId>
    <artifactId>jo-json</artifactId>
    <version>1.3.1</version>
</dependency>
// https://jarcasting.com/artifacts/se.llbit/jo-json/
implementation 'se.llbit:jo-json:1.3.1'
// https://jarcasting.com/artifacts/se.llbit/jo-json/
implementation ("se.llbit:jo-json:1.3.1")
'se.llbit:jo-json:jar:1.3.1'
<dependency org="se.llbit" name="jo-json" rev="1.3.1">
  <artifact name="jo-json" type="jar" />
</dependency>
@Grapes(
@Grab(group='se.llbit', module='jo-json', version='1.3.1')
)
libraryDependencies += "se.llbit" % "jo-json" % "1.3.1"
[se.llbit/jo-json "1.3.1"]

Dependencies

test (1)

Group / Artifact Type Version
junit : junit jar 4.11

Project Modules

There are no modules declared in this project.

Simple Java JSON Library

Javadocs Build Status codecov

Small Java JSON library.

I made this library originally as an exercise in using JastAdd to build a JSON library, however the library has been converted to a static Java project to get rid of some of the JastAdd overhead (parent pointers, child vector, attribute visit flags).

Copyright (c) 2013-2017, Jesper Öqvist

This project is provided under the Modified BSD License. See the LICENSE file, in the same directory as this README file.

Requirements

This library requires Java 7+ to build.

Examples

Here is an example snippet showing how to parse a JSON input stream and read the parsed data:

import se.llbit.json.*;
...

try (JsonParser parser = new JsonParser(inputStream)) {
  JsonValue json = parser.parse();
  for (JsonValue entry : json.asArray()) {
    JsonObject person = entry.asObject();
    String name = person.get("name").asString("name");
    int age = person.get("age").asInt(-1);
    System.out.format("%s is %d years old%n", name, age);
  }
}

The input for the above example could look something like this:

[ { "name": "Alice", "age": 10 }, { "name": "Bob", "age": -31 } ]

Versions

Version
1.3.1
1.3.0