Package org.apache.jena.atlas.io

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


    }
   
    /** 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


    public void arraySep() {
        out.print(ArraySep) ;
    }

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

       
        if ( printNone )
            return ;
       
        // And some checking.
        IndentedLineBuffer w = new IndentedLineBuffer() ;
        UpdateWriter.output(req, w) ;
        String updateString2 = w.asString() ;
        UpdateRequest req2 = null ;
        try {
            req2 = UpdateFactory.create(updateString2, updateSyntax) ;
        } catch (QueryParseException ex)
        {
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

    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

            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

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.