Package org.openjena.atlas.io

Examples of org.openjena.atlas.io.IndentedLineBuffer


        return printString(struct, " ") ;
    }
   
    public static <T extends Printable> String printString(Iterable<? extends T> struct, String sep)
    {
        IndentedLineBuffer b = new IndentedLineBuffer() ;
        apply(struct, new ActionPrint<T>(b, sep)) ;
        return b.asString() ;
    }
View Full Code Here


    @Override
    public String asSQL() { return asSQL(this) ; }
   
    public static String asSQL(SqlExpr expr)
    {
        IndentedLineBuffer buff = new IndentedLineBuffer() ;
        SqlExprVisitor v = new SqlExprGenerateSQL(buff) ;
        expr.visit(v) ;
        return buff.toString() ;
    }
View Full Code Here

        }
        //req.output(IndentedWriter.stderr) ;
        System.out.print(req) ;
       
        // 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 asString(Element el)
    {
        SerializationContext cxt = new SerializationContext() ;
        IndentedLineBuffer b = new IndentedLineBuffer() ;
        FormatterElement.format(b, cxt, el) ;
        return b.toString() ;
    }
View Full Code Here

        checkOp(query, optimizeAlgebra) ;
    }

    public static void checkOp(Query query, boolean optimizeAlgebra)
    {
        IndentedLineBuffer buff = new IndentedLineBuffer() ;
        Op op = Algebra.compile(query) ;
        if ( optimizeAlgebra )
            op = Algebra.optimize(op) ;
        WriterSSE.out(buff, op, query) ;
        String str = buff.toString() ;
       
        try {
            Op op2 = SSE.parseOp(str) ;
            if ( op.hashCode() != op2.hashCode() )
            {
View Full Code Here

    public static void checkParse(Query query)
    {
        if ( ! ParserRegistry.get().containsFactory(query.getSyntax()) )
            return ;
       
        IndentedLineBuffer buff = new IndentedLineBuffer() ;
        query.serialize(buff, query.getSyntax()) ;
       
        String tmp = buff.toString() ;
       
        Query query2 = null ;
        try {
            String baseURI = null ;
            if ( ! query.explicitlySetBaseURI() )
View Full Code Here

public class QueryOutputUtils
{
    // ---- PrintSerializable
    public static String toString(PrintSerializable item, PrefixMapping pmap)
    {
        IndentedLineBuffer buff = new IndentedLineBuffer() ;
        SerializationContext sCxt = new SerializationContext(pmap) ;
        item.output(buff, sCxt) ;
        return buff.toString() ;
    }
View Full Code Here

    }
   
    public static String asString(Template template)
    {
        SerializationContext cxt = new SerializationContext() ;
        IndentedLineBuffer b = new IndentedLineBuffer() ;
        FmtTemplate.format(b, cxt, template) ;
        return b.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(" ") ;
            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

    }

    @Override
    public String toString()
    {
        IndentedLineBuffer iBuff = new IndentedLineBuffer() ;
        ItemWriter.write(iBuff, this, null) ;
        //iBuff.getIndentedWriter().ensureStartOfLine() ;
        //iBuff.getIndentedWriter().flush() ;
        return iBuff.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.