Package org.apache.jena.atlas.io

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


    }

    /** Write out a JSON value - pass a JSON Object to get legal exchangeable JSON */
    public static void write(OutputStream output, JsonValue jValue)
    {
        IndentedWriter iOut = new IndentedWriter(output) ;
        write(iOut, jValue) ;
        iOut.flush() ;
    }
View Full Code Here


    public JSWriter() {
        this(IndentedWriter.stdout) ;
    }

    public JSWriter(OutputStream ps) { this(new IndentedWriter(ps)) ; }
View Full Code Here

{
    IndentedWriter out ;
   
    public JsonWriter() { this(IndentedWriter.stdout) ; }
    @Deprecated
    public JsonWriter(OutputStream ps) { this(new IndentedWriter(ps)) ; }
View Full Code Here

    IndentedWriter out ; 
   
    @Override
    public void startParse(long currLine, long currCol)
    {
        out = new IndentedWriter(System.out, true) ;
        //out.setPadString("> ") ;
    }
View Full Code Here

        print(bgp2) ;
        System.out.println() ;
    }
   
    private static void print(BasicPattern bgp) {
        IndentedWriter out = IndentedWriter.stdout;
       
        PrefixMapping pmap = new PrefixMappingImpl() ;
        pmap.setNsPrefixes(SSE.defaultPrefixMapWrite) ;
//        pmap.setNsPrefix("ppi", "http://landregistry.data.gov.uk/def/ppi/") ;
//        pmap.setNsPrefix("common", "http://landregistry.data.gov.uk/def/common/") ;
       
        SerializationContext sCxt = SSE.sCxt(pmap) ;
       
        boolean first = true ;
        for ( Triple t : bgp )
        {
            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();
       
    }
View Full Code Here

    public static void dump(OutputStream w, NodeTable nodeTable)
    {
        // Better to hack the indexes?
        Iterator<Pair<NodeId, Node>> iter = nodeTable.all() ;
        long count = 0 ;
        IndentedWriter iw = new IndentedWriter(w) ;
        for ( ; iter.hasNext() ; )
        {
            Pair<NodeId, Node> pair = iter.next() ;
            iw.print(pair.car().toString()) ;
            iw.print(" : ") ;
            //iw.print(pair.cdr()) ;
            Node n = pair.cdr() ;
            String $ = stringForNode(n) ;
            iw.print($) ;
            iw.println() ;
            count++ ;
        }
        iw.println() ;
        iw.printf("Total: "+count) ;
        iw.println() ;
        iw.flush() ;
    }
View Full Code Here

    {
        try{
            Query query = modQuery.getQuery() ;
            if ( isVerbose() )
            {
                IndentedWriter out = new IndentedWriter(System.out, true) ;
                query.serialize(out) ;
                out.flush() ;
                System.out.println();
            }
           
            if ( isQuiet() )
                LogCtl.setError(SysRIOT.riotLoggerName) ;
View Full Code Here

        String queryString = prolog + NL +
            "SELECT ?title WHERE {?x dc:title ?title}" ;
       
        Query query = QueryFactory.create(queryString) ;
        // Print with line numbers
        query.serialize(new IndentedWriter(System.out,true)) ;
        System.out.println() ;
       
        // Create a single execution of this query, apply to a model
        // which is wrapped up as a Dataset
       
View Full Code Here

        return Lang.TURTLE ;
    }

    @Override
    public void write(Writer out, Graph graph, PrefixMap prefixMap, String baseURI, Context context) {
        IndentedWriter iOut = RiotLib.create(out) ;
        output$(iOut, graph, prefixMap, baseURI) ;
    }
View Full Code Here

        output$(iOut, graph, prefixMap, baseURI) ;
    }

    @Override
    public void write(OutputStream out, Graph graph, PrefixMap prefixMap, String baseURI, Context context) {
        IndentedWriter iOut = new IndentedWriter(out) ;
        output$(iOut, graph, prefixMap, baseURI) ;
    }
View Full Code Here

TOP

Related Classes of org.apache.jena.atlas.io.IndentedWriter

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.