Package org.apache.jena.atlas.io

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


    }
   
    @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 asString(Path path) { return asString(path, null) ; }
   
    public static String asString(Path path, Prologue prologue)
    {
        IndentedLineBuffer buff = new IndentedLineBuffer() ;
        WriterPathVisitor w = new WriterPathVisitor(buff, prologue) ;
        path.visit(w) ;
        w.out.flush();
        return buff.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

   
    @Override
    public String toString()
    {
        // Using the size of the graphs would be better.
        IndentedLineBuffer out = new IndentedLineBuffer() ;
        WriterGraph.output(out, this, null) ;
        return out.asString() ;
    }
View Full Code Here

public class WriterExpr
{
   
    public static String asString(Expr expr)
    {
        IndentedLineBuffer b = new IndentedLineBuffer() ;
        output(b, expr, null) ;
        return b.asString() ;
    }
View Full Code Here

     * Gets user friendly version information for all registered classes as a string
     * @param singleLine Whether to print to a single line
     * @return Version information
     */
    public String toString(boolean singleLine) {
        IndentedLineBuffer buffer = new IndentedLineBuffer(false);
       
        Iterator<Class<?>> iter = classes.iterator();
        while (iter.hasNext())
        {
            Class<?> c = iter.next();
            String component = Utils.classShortName(c) ;
            String version = field(FIELD_VERSION, c);
            String timestamp = field(FIELD_BUILD_DATE, c);
            buffer.append("%s Version %s (Built %s)", component, version, timestamp);
            if (iter.hasNext()) {
                if (!singleLine) {
                    buffer.println();
                } else {
                    buffer.print(", ");
                }
            }
        }
       
        return buffer.asString();
    }
View Full Code Here

        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

        return t.acc ;
    }

    @Override public String toString()
    {
        IndentedLineBuffer buff = new IndentedLineBuffer() ;
        output(buff, true) ;
        return buff.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.