Package org.apache.jena.atlas.io

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


     * @param syntax
     */
   
    public String serialize(Syntax syntax)
    {
        IndentedLineBuffer buff = new IndentedLineBuffer() ;
        serialize(buff, syntax) ;
        return buff.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 ( ! SPARQLParserRegistry.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 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

        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

     * 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

    }

    @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

            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

public class TestIndentedWriter extends BaseTest
{
    @Test public void write01()
    {
        IndentedLineBuffer b = new IndentedLineBuffer() ;
        b.print("hell") ;
        b.print("o") ;
        assertEquals("hello", b.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.