Package org.openjena.atlas.io

Examples of org.openjena.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

    public static void explain(String message, Query query, Context context)
    {
        if ( explaining(InfoLevel.INFO, logExec, context) )
        {
            // One line or indented multiline format
            IndentedLineBuffer iBuff = new IndentedLineBuffer() ;
            if ( true )
                iBuff.incIndent() ;
            else
                iBuff.setFlatMode(true) ;
            query.serialize(iBuff) ;
            String x = iBuff.asString() ;
            _explain(logExec, message, x, true) ;
        }
    }
View Full Code Here

   
    public static void explain(String message, Op op, Context context)
    {
        if ( explaining(InfoLevel.FINE, logExec, context) )
        {
            IndentedLineBuffer iBuff = new IndentedLineBuffer() ;
            if ( true )
                iBuff.incIndent() ;
            else
                iBuff.setFlatMode(true) ;
            op.output(iBuff) ;
            String x = iBuff.asString() ;
            _explain(logExec, message, x, true) ;
        }
    }
View Full Code Here

   
    public static void explain(String message, QuadPattern quads, Context context)
    {
        if ( explaining(InfoLevel.ALL, logExec,context) )
        {
            IndentedLineBuffer iBuff = new IndentedLineBuffer() ;
            if ( true )
                iBuff.incIndent() ;
            else
                iBuff.setFlatMode(true) ;
            formatQuads(iBuff, quads) ;
            iBuff.flush() ;
            String str = iBuff.toString() ;
            _explain(logExec, message, str, false) ;
        }
    }
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

    }
   
    /** Generate an SQL string for the node - which may no tbe legal SQL (e.g. no outer SELECT).*/ 
    public String generatePartSQL(SqlNode sqlNode)
    {
        IndentedLineBuffer buff = new IndentedLineBuffer() ;
       
        // Step one - rewrite the SQL node tree to have SelectBlocks, not the various SqlNodes
        // that contribute to a SELECT statement.
       
        // XXX Temp - the nodes this tranforms should not be generated now
        //sqlNode = SqlTransformer.transform(sqlNode, new TransformSelectBlock()) ;

        // Step two - turn the SqlNode tree, with SqlSelectBlocks in it,
        // in an SQL string.
        SqlNodeVisitor v = makeVisitor(buff) ;
        sqlNode.visit(v) ;
        return buff.asString() ;
    }
View Full Code Here

        out.flush();
    }
   
    public String dumpToString()
    {
        IndentedLineBuffer buff = new IndentedLineBuffer() ;
        output(buff) ;
        return buff.asString() ;
    }
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

TOP

Related Classes of org.openjena.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.