Package org.apache.jena.atlas.io

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


     * @return Copy of this query
     */
    public Query cloneQuery(boolean useRawQuery)
    {
        // A little crude.
        IndentedLineBuffer buff = new IndentedLineBuffer() ;
        serialize(buff, getSyntax()) ;
        String qs = buff.toString() ;
        return QueryFactory.create(qs, getSyntax()) ;
    }
View Full Code Here


    /** Convert the query to a string */
   
    public String serialize()
    {
        IndentedLineBuffer buff = new IndentedLineBuffer() ;
        serialize(buff) ;
        return buff.toString();
    }
View Full Code Here

     * @param syntax
     */
   
    public String serialize(Syntax syntax)
    {
        IndentedLineBuffer buff = new IndentedLineBuffer() ;
        serialize(buff, syntax) ;
        return buff.toString();
    }
View Full Code Here

    }
   
    @Override
    public String toString()
    {
        IndentedLineBuffer out = new IndentedLineBuffer() ;
       
        SerializationContext sCxt = SSE.sCxt((SSE.defaultPrefixMapWrite)) ;
       
        boolean first = true ;
        for ( Triple t : triples )
        {
            if ( !first )
                out.print("\n") ;
            else
                first = false ;
            // Adds (triple ...)
            // SSE.write(buff.getIndentedWriter(), t) ;
            out.print("(") ;
            WriterNode.outputPlain(out, t, sCxt) ;
            out.print(")") ;
        }
        out.flush();
        return out.toString() ;
    }
View Full Code Here

    public static String stringEsc(String s)
    { return stringEsc(s, true, false) ; }

    private static String stringEsc(String s, boolean singleLineString, boolean asciiOnly)
    {
        IndentedLineBuffer sb = new IndentedLineBuffer() ;
        stringEsc(sb, s, singleLineString, asciiOnly) ;
        return sb.toString() ;
    }
View Full Code Here

   

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

        return sw.toString() ;
    }

    public static String str(Node n)
    {
        IndentedLineBuffer sw = new IndentedLineBuffer() ;
        str(sw, n) ;
        return sw.toString() ;
    }
View Full Code Here

    @Test
    public void test_version_print_01() {
        Version ver = new Version();
        ver.addClass(ARQ.class);
       
        IndentedLineBuffer buffer = new IndentedLineBuffer();
        ver.print(buffer);
       
        String info = buffer.asString();
        Assert.assertNotNull(info);
        Assert.assertTrue(info.contains("ARQ"));
    }
View Full Code Here

            errorOccurred("Unknown or invalid result type") ;
    }
   
    private String formatForLog(Query query)
    {
        IndentedLineBuffer out = new IndentedLineBuffer() ;
        out.setFlatMode(true) ;
        query.serialize(out) ;
        return out.asString() ;
    }
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

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.