use of org.apache.jena.atlas.io.StringWriterI in project jena by apache.
the class EscapeStr method stringEsc.
/*
* Escape characters in a string according to Turtle rules.
*/
public static String stringEsc(String s) {
AWriter w = new StringWriterI();
stringEsc(w, s, Chars.CH_QUOTE2, true, CharSpace.UTF8);
return w.toString();
}
use of org.apache.jena.atlas.io.StringWriterI in project jena by apache.
the class TestNodeFmt method test.
public static void test(NodeFormatter nodeFormatter, Node n, String str) {
StringWriterI sw = new StringWriterI();
nodeFormatter.format(sw, n);
String str2 = sw.toString();
assertEquals(str, str2);
}
use of org.apache.jena.atlas.io.StringWriterI in project jena by apache.
the class TestQuotedStringOutput method testSingleLine.
static void testSingleLine(QuotedStringOutput proc, String input, String expected) {
StringWriterI w = new StringWriterI();
proc.writeStr(w, input);
String output = w.toString();
expected = proc.getQuoteChar() + expected + proc.getQuoteChar();
assertEquals(expected, output);
}
use of org.apache.jena.atlas.io.StringWriterI in project jena by apache.
the class TestQuotedStringOutput method testMultiLine.
static void testMultiLine(QuotedStringOutput proc, String input, String expected) {
StringWriterI w = new StringWriterI();
proc.writeStrMultiLine(w, input);
String output = w.toString();
assertEquals(expected, output);
}
Aggregations