Java

RJOSN parsers and formatters for Java and Kotlin.

API

http://www.relaxedjson.org/docs/api

Download

RJSON Parser and Formatter (Latest Snapshots)

Gradle Groovy

repositories {
    maven('https://oss.sonatype.org/content/repositories/snapshots')
}
compile 'tv.twelvetone.rjson:rjson:1.3.0-SNAPSHOT'

Gradle Kotlin

repositories {
    maven {
        url = uri("https://oss.sonatype.org/content/repositories/snapshots")
    }
}    
compile("tv.twelvetone.rjson:rjson:1.3.0-SNAPSHOT")

Maven

<repository>
    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
<dependency>
    <groupid>tv.twelvetone.rjson</groupid>
    <artifactid>rjson</artifactid>
    <version>1.3.0-SNAPSHOT</version>
</dependency>

Usage

Demo Project

To run the demo project, go to the demo directory and type.

./gradlew test

build.gradle.kts

plugins {
    `java`
}

repositories {
    mavenCentral()
    maven("https://oss.sonatype.org/content/repositories/snapshots")
}

dependencies {
    testCompile(tv.twelvetone.rjson:rjson:1.0-SNAPSHOT")
    testCompile("junit:junit:4.12")
}

TestRjsonParser.java

import org.junit.Assert;
import org.junit.Test;
import tv.twelvetone.json.JsonValue;
import tv.twelvetone.rjson.RJsonParserFactory;

public class TestRjsonParser {
    @Test
    public void testRsjonParser() {
        JsonValue parsed = new RJsonParserFactory().createParser().stringToValue("{hello:world}");
        Assert.assertEquals("{\"hello\":\"world\"}", parsed.toString());
    }
}


This site is StackEditPro enabled.