delight-json

Rendering of simple, human-readable JSON documents.

License

License

GPL
Categories

Categories

JSON Data
GroupId

GroupId

org.javadelight
ArtifactId

ArtifactId

delight-json
Last Version

Last Version

0.0.5
Release Date

Release Date

Type

Type

bundle
Description

Description

delight-json
Rendering of simple, human-readable JSON documents.
Project URL

Project URL

https://github.com/javadelight/delight-json
Source Code Management

Source Code Management

https://github.com/javadelight/delight-json

Download delight-json

Dependencies

provided (1)

Group / Artifact Type Version
com.google.gwt : gwt-user jar 2.8.2

test (2)

Group / Artifact Type Version
org.eclipse.xtend : org.eclipse.xtend.lib.gwt jar 2.13.0
com.github.oehme.xtend : xtend-junit jar 0.0.1

Project Modules

There are no modules declared in this project.

Build Status

delight-json

delight-json is an extremely simple library to render human-readable JSON with Java.

Why: A simple and very portable way to generate beautiful, human-readable JSON.

delight-json is part of Java Delight.

Usage

JSON Objects

JSON json = JSON.create();

json.add("text", "hello");
json.add("number", 123);

json.print();

Results in:

{
    'text': 'hello',
    'number': '123'
}

Nested JSON Objects

JSON documents may be added as values to other JSON documents.

final JSON json = JSON.create();

json.add("text", "hello");
json.add("inner", JSON.create().add("number", 1234));

json.print();

Results in:

{
    'text': 'hello',
    'inner': {
        'number': '1234'
    }
}

JSON Arrays

Arrays can be added as values of JSON documents.

JSON json = JSON.create();
        
json.add("array", JSON.createArray().push("1").push("2").push("3"));

json.print();

Results in:

{
    'array': [
        '1',
        '2',
        '3'
    ]
}

Rendering

Documents can either be printed to standard out:

json.print();

Or rendered as String:

String str = json.render();

Maven Dependency

<dependency>
    <groupId>org.javadelight</groupId>
	<artifactId>delight-json</artifactId>
	<version>[latest version]</version>
</dependency>

This artifact is available on Maven Central and BinTray.

Maven Central

Compatibility

This project is compatible with the following environments:

  • Java 1.6+
  • GWT 2.5.0+
  • Android (any)
  • OSGi (any)

Further Resources

Licenses

  • Apache 2.0

  • MIT

Versions

Version
0.0.5