Search in sources :

Example 56 with IndentedLineBuffer

use of org.apache.jena.atlas.io.IndentedLineBuffer in project jena by apache.

the class JSON method toStringFlat.

/** JsonValue to a string with no newlines */
public static String toStringFlat(JsonValue jValue) {
    try (IndentedLineBuffer b = new IndentedLineBuffer()) {
        b.setFlatMode(true);
        JSON.write(b, jValue);
        return b.asString();
    }
}
Also used : IndentedLineBuffer(org.apache.jena.atlas.io.IndentedLineBuffer)

Example 57 with IndentedLineBuffer

use of org.apache.jena.atlas.io.IndentedLineBuffer in project jena by apache.

the class JsonValue method toString.

@Override
public String toString() {
    IndentedLineBuffer buff = new IndentedLineBuffer();
    output(buff);
    return buff.asString();
}
Also used : IndentedLineBuffer(org.apache.jena.atlas.io.IndentedLineBuffer)

Example 58 with IndentedLineBuffer

use of org.apache.jena.atlas.io.IndentedLineBuffer in project jena by apache.

the class JSWriter method outputQuotedString.

public static String outputQuotedString(String string) {
    IndentedLineBuffer b = new IndentedLineBuffer();
    outputQuotedString(b, string);
    return b.asString();
}
Also used : IndentedLineBuffer(org.apache.jena.atlas.io.IndentedLineBuffer)

Example 59 with IndentedLineBuffer

use of org.apache.jena.atlas.io.IndentedLineBuffer in project jena by apache.

the class Query method serialize.

/** Convert the query to a string in the given syntax
     * @param syntax
     */
public String serialize(Syntax syntax) {
    IndentedLineBuffer buff = new IndentedLineBuffer();
    serialize(buff, syntax);
    return buff.toString();
}
Also used : IndentedLineBuffer(org.apache.jena.atlas.io.IndentedLineBuffer)

Example 60 with IndentedLineBuffer

use of org.apache.jena.atlas.io.IndentedLineBuffer in project jena by apache.

the class NodeFmtLib method strNodes.

// Worker
public static String strNodes(Node... nodes) {
    IndentedLineBuffer sw = new IndentedLineBuffer();
    boolean first = true;
    for (Node n : nodes) {
        if (!first)
            sw.append(" ");
        first = false;
        str(sw, n);
    }
    return sw.toString();
}
Also used : RDFNode(org.apache.jena.rdf.model.RDFNode) Node(org.apache.jena.graph.Node) IndentedLineBuffer(org.apache.jena.atlas.io.IndentedLineBuffer)

Aggregations

IndentedLineBuffer (org.apache.jena.atlas.io.IndentedLineBuffer)63 Test (org.junit.Test)10 SerializationContext (org.apache.jena.sparql.serializer.SerializationContext)5 Expr (org.apache.jena.sparql.expr.Expr)3 WriterExpr (org.apache.jena.sparql.sse.writers.WriterExpr)3 BasicPattern (org.apache.jena.sparql.core.BasicPattern)2 QueryCheckException (org.apache.jena.sparql.core.QueryCheckException)2 SSEParseException (org.apache.jena.sparql.sse.SSEParseException)2 UpdateRequest (org.apache.jena.update.UpdateRequest)2 Version (org.apache.jena.atlas.lib.Version)1 DatasetRef (org.apache.jena.fuseki.server.DatasetRef)1 Node (org.apache.jena.graph.Node)1 Triple (org.apache.jena.graph.Triple)1 Query (org.apache.jena.query.Query)1 QueryException (org.apache.jena.query.QueryException)1 QueryParseException (org.apache.jena.query.QueryParseException)1 RDFNode (org.apache.jena.rdf.model.RDFNode)1 PrefixMapping (org.apache.jena.shared.PrefixMapping)1 Op (org.apache.jena.sparql.algebra.Op)1 DatasetGraph (org.apache.jena.sparql.core.DatasetGraph)1