use of org.apache.jena.atlas.io.IndentedLineBuffer in project jena by apache.
the class PathWriter method asString.
public static String asString(Path path, Prologue prologue) {
IndentedLineBuffer buff = new IndentedLineBuffer();
PathWriterWorker w = new PathWriterWorker(buff, prologue);
path.visit(w);
w.out.flush();
return buff.asString();
}
use of org.apache.jena.atlas.io.IndentedLineBuffer in project jena by apache.
the class TestUpdateWriter method test.
private void test(String updateString) {
UpdateRequest update1 = UpdateFactory.create(updateString);
IndentedLineBuffer w = new IndentedLineBuffer();
UpdateWriter.output(update1, w);
String s = w.asString();
UpdateRequest update2 = UpdateFactory.create(s);
assertTrue(update1.equalTo(update2));
}
use of org.apache.jena.atlas.io.IndentedLineBuffer in project jena by apache.
the class QueryValidator method output.
private void output(ServletOutputStream outStream, Content content, boolean lineNumbers) throws IOException {
startFixed(outStream);
IndentedLineBuffer out = new IndentedLineBuffer(lineNumbers);
content.print(out);
out.flush();
String x = htmlQuote(out.asString());
byte[] b = x.getBytes("UTF-8");
outStream.write(b);
finishFixed(outStream);
}
use of org.apache.jena.atlas.io.IndentedLineBuffer in project jena by apache.
the class StreamsPrint method printString.
public static <T extends Printable> String printString(Iterable<? extends T> struct, String sep) {
IndentedLineBuffer b = new IndentedLineBuffer();
apply(struct.iterator(), new ActionPrint<T>(b, sep));
return b.asString();
}
use of org.apache.jena.atlas.io.IndentedLineBuffer in project jena by apache.
the class Query method serialize.
/** Convert the query to a string */
public String serialize() {
IndentedLineBuffer buff = new IndentedLineBuffer();
serialize(buff);
return buff.toString();
}
Aggregations