Search in sources :

Example 1 with JsonValue

use of org.apache.jena.atlas.json.JsonValue in project jena by apache.

the class LibJsonTest method read.

/** Read-compare */
public static void read(String string, JsonValue expected) {
    JsonValue v = JSON.parseAny(string);
    assertEquals(expected, v);
}
Also used : JsonValue(org.apache.jena.atlas.json.JsonValue)

Example 2 with JsonValue

use of org.apache.jena.atlas.json.JsonValue in project jena by apache.

the class LibJsonTest method writeRead.

/** Round trip json->string->json */
public static void writeRead(JsonValue v) {
    String str2 = v.toString();
    JsonValue v2 = JSON.parseAny(str2);
    assertEquals(v, v2);
}
Also used : JsonValue(org.apache.jena.atlas.json.JsonValue)

Example 3 with JsonValue

use of org.apache.jena.atlas.json.JsonValue in project jena by apache.

the class TestJsonWriter method test.

private static void test(String str, String expected) {
    JsonValue v = new JsonString(str);
    str = v.toString();
    assertEquals(expected, str);
}
Also used : JsonValue(org.apache.jena.atlas.json.JsonValue) JsonString(org.apache.jena.atlas.json.JsonString)

Example 4 with JsonValue

use of org.apache.jena.atlas.json.JsonValue in project jena by apache.

the class ActionContainerItem method execGet.

protected void execGet(HttpAction action) {
    JsonValue v;
    if (isContainerAction(action))
        v = execGetContainer(action);
    else
        v = execGetItem(action);
    ServletOps.sendJsonReponse(action, v);
}
Also used : JsonValue(org.apache.jena.atlas.json.JsonValue)

Example 5 with JsonValue

use of org.apache.jena.atlas.json.JsonValue in project jena by apache.

the class ActionContainerItem method execPost.

protected void execPost(HttpAction action) {
    JsonValue v;
    if (isContainerAction(action))
        v = execPostContainer(action);
    else
        v = execPostItem(action);
    ServletOps.sendJsonReponse(action, v);
}
Also used : JsonValue(org.apache.jena.atlas.json.JsonValue)

Aggregations

JsonValue (org.apache.jena.atlas.json.JsonValue)28 Test (org.junit.Test)7 JsonArray (org.apache.jena.atlas.json.JsonArray)4 JsonObject (org.apache.jena.atlas.json.JsonObject)4 TypedInputStream (org.apache.jena.atlas.web.TypedInputStream)3 JsonBuilder (org.apache.jena.atlas.json.JsonBuilder)2 AsyncTask (org.apache.jena.fuseki.async.AsyncTask)2 ServletOutputStream (javax.servlet.ServletOutputStream)1 JsonParseException (org.apache.jena.atlas.json.JsonParseException)1 JsonString (org.apache.jena.atlas.json.JsonString)1 HttpException (org.apache.jena.atlas.web.HttpException)1 AsyncPool (org.apache.jena.fuseki.async.AsyncPool)1 Node (org.apache.jena.graph.Node)1 LabelToNode (org.apache.jena.riot.lang.LabelToNode)1 Var (org.apache.jena.sparql.core.Var)1 BindingMap (org.apache.jena.sparql.engine.binding.BindingMap)1