Package org.apache.jena.atlas.io

Examples of org.apache.jena.atlas.io.IndentedLineBuffer


        assertEquals("hello", b.asString()) ;
    }
   
    @Test public void write02()
    {
        IndentedLineBuffer b = new IndentedLineBuffer() ;
        b.incIndent() ;
        b.print("hell") ;
        b.print("o") ;
        b.decIndent() ;
        assertEquals("  hello", b.asString()) ;
    }
View Full Code Here


        assertEquals("  hello", b.asString()) ;
    }
   
    @Test public void write03()
    {
        IndentedLineBuffer b = new IndentedLineBuffer() ;
        b.incIndent() ;
        b.printf("0x%04X", 1) ;
        b.println() ;
        b.print("XX") ;
        b.decIndent() ;
        assertEquals("  0x0001\n  XX", b.asString()) ;
    }
View Full Code Here

   
   
    public static String asString(Element el)
    {
        SerializationContext cxt = new SerializationContext() ;
        IndentedLineBuffer b = new IndentedLineBuffer() ;
        FormatterElement.format(b, cxt, el) ;
        return b.toString() ;
    }
View Full Code Here

      out.print(ArraySep);
    }
   
    public static String outputQuotedString(String string)
    {
        IndentedLineBuffer b = new IndentedLineBuffer() ;
        outputQuotedString(b, string) ;
        return b.asString() ;
    }
View Full Code Here

        runTestWorker(query, query.getSyntax()) ;
    }
   
    protected void runTestWorker(Query query, Syntax syntax)
    {
        IndentedLineBuffer buff = new IndentedLineBuffer() ;
        query.serialize(buff, syntax) ;
        String baseURI = null ;
       
        if ( ! query.explicitlySetBaseURI() )
            // Not in query - use the same one (e.g. file read from) . 
View Full Code Here

public class TableWriter
{
    public static String asSSE(Table table)
    {
        IndentedLineBuffer out = new IndentedLineBuffer() ;
        TableWriter.output(table, out) ;
        return out.asString() ;
    }
View Full Code Here

        fmtSPARQL(iOut, expr, FmtUtils.sCxt()) ;
    }
   
    public static String fmtSPARQL(Expr expr)
    {
        IndentedLineBuffer buff = new IndentedLineBuffer() ;
        fmtSPARQL(buff, expr) ;
        return buff.toString() ;
    }
View Full Code Here

        fmtSPARQL(iOut, exprs, FmtUtils.sCxt()) ;
    }

    public static String fmtSPARQL(ExprList exprs)
    {
        IndentedLineBuffer buff = new IndentedLineBuffer() ;
        fmtSPARQL(buff, exprs) ;
        return buff.toString() ;
    }
View Full Code Here

    }

    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) ;
    }
View Full Code Here

    interface Content { void print(IndentedWriter out) ; }
   
    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) ;
    }
View Full Code Here

TOP

Related Classes of org.apache.jena.atlas.io.IndentedLineBuffer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.