Package org.apache.jena.atlas.io

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


    }
   
    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


   
   
    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

import com.hp.hpl.jena.sparql.serializer.SerializationContext ;
import com.hp.hpl.jena.sparql.util.FmtUtils ;

public class TableWriter {
    public static String asSSE(Table table) {
        IndentedLineBuffer out = new IndentedLineBuffer() ;
        TableWriter.output(table, out) ;
        return out.asString() ;
    }
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 String asString(Path path) { return asString(path, null) ; }
   
    public static String asString(Path path, Prologue prologue)
    {
        IndentedLineBuffer buff = new IndentedLineBuffer() ;
        PathWriterWorker w = new PathWriterWorker(buff, prologue) ;
        path.visit(w) ;
        w.out.flush();
        return buff.asString() ;
    }
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

        return true ;
    }
   
    @Override
    public String toString() {
        IndentedLineBuffer out = new IndentedLineBuffer() ;

        SerializationContext sCxt = SSE.sCxt((SSE.defaultPrefixMapWrite)) ;

        boolean first = true ;
        for (Quad quad : quads) {
            if ( !first )
                out.print(" ") ;
            else
                first = false ;
            // Adds (triple ...)
            // SSE.write(buff.getIndentedWriter(), t) ;
            out.print("(") ;
            WriterNode.outputPlain(out, quad, sCxt) ;
            out.print(")") ;
        }
        out.flush() ;
        return out.toString() ;
    }
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

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.