jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1224901 - in /incubator/jena/Jena2/ARQ/trunk/src/main/java: com/hp/hpl/jena/sparql/resultset/XMLOutputResultSet.java org/openjena/atlas/io/IndentedWriter.java
Date Tue, 27 Dec 2011 12:39:35 GMT
Author: andy
Date: Tue Dec 27 12:39:35 2011
New Revision: 1224901

URL: http://svn.apache.org/viewvc?rev=1224901&view=rev
Log: (empty)

Modified:
    incubator/jena/Jena2/ARQ/trunk/src/main/java/com/hp/hpl/jena/sparql/resultset/XMLOutputResultSet.java
    incubator/jena/Jena2/ARQ/trunk/src/main/java/org/openjena/atlas/io/IndentedWriter.java

Modified: incubator/jena/Jena2/ARQ/trunk/src/main/java/com/hp/hpl/jena/sparql/resultset/XMLOutputResultSet.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/main/java/com/hp/hpl/jena/sparql/resultset/XMLOutputResultSet.java?rev=1224901&r1=1224900&r2=1224901&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/main/java/com/hp/hpl/jena/sparql/resultset/XMLOutputResultSet.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/main/java/com/hp/hpl/jena/sparql/resultset/XMLOutputResultSet.java
Tue Dec 27 12:39:35 2011
@@ -80,14 +80,6 @@ public class XMLOutputResultSet
         out.print(dfNamespace) ;
         out.println("\">") ;
 
-        // Remove this next you see it.
-//       out.incIndent(INDENT) ;
-//       out.incIndent(INDENT) ;
-//       out.println("xmlns:rdf=\""+ARQConstants.rdfPrefix+"\"") ;
-//       out.println("xmlns:xs=\""+ARQConstants.XML_SCHEMA_NS+"\"") ;
-//       out.println("xmlns=\""+dfNamespace+"\" >") ;
-//       out.decIndent(INDENT) ;
-//       out.decIndent(INDENT) ;
         // ---- Header
 
         out.incIndent(INDENT) ;

Modified: incubator/jena/Jena2/ARQ/trunk/src/main/java/org/openjena/atlas/io/IndentedWriter.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/main/java/org/openjena/atlas/io/IndentedWriter.java?rev=1224901&r1=1224900&r2=1224901&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/main/java/org/openjena/atlas/io/IndentedWriter.java
(original)
+++ incubator/jena/Jena2/ARQ/trunk/src/main/java/org/openjena/atlas/io/IndentedWriter.java
Tue Dec 27 12:39:35 2011
@@ -19,11 +19,10 @@
 package org.openjena.atlas.io;
 import static java.lang.String.format ;
 
-import java.io.IOException ;
-import java.io.OutputStream ;
-import java.io.Writer ;
+import java.io.* ;
 
 import org.openjena.atlas.AtlasException ;
+import org.openjena.atlas.lib.Chars ;
 
 /** A writer that records what the current indentation level is, and
  *  uses that to insert a prefix at each line. 
@@ -64,8 +63,15 @@ public class IndentedWriter
     /** Construct a UTF8 IndentedWriter around an OutputStream */
     public IndentedWriter(OutputStream outStream, boolean withLineNumbers)
     {
-        //this(FileUtils.asPrintWriterUTF8(outStream), withLineNumbers) ;
-        this(BufferingWriter.create(outStream), withLineNumbers) ;
+        this(makeWriter(outStream), withLineNumbers) ;
+    }
+    
+    private static Writer makeWriter(OutputStream out)
+    {
+        // Create a writer for the output.
+        Writer w = new OutputStreamWriter(out, Chars.createEncoder()) ;
+        w =  new BufferedWriter(w, 8*1024) ;
+        return w ;
     }
     
     /** Using Writers directly is discouraged */
@@ -78,16 +84,18 @@ public class IndentedWriter
         lineNumbers = withLineNumbers ;
         startingNewLine = true ;
     }
-    
-    // Internally, use \n for newline.
-    // On output, we use the platform PrintWriter.println()
-    // public void print(String s) { lineStart() ; out.print(s) ; column += s.length() ;
}
-    
+
     public void print(Object obj) 
     {
         String s = "null" ;
         if ( obj != null )
             s = obj.toString() ;
+        if ( false )
+        {
+            // Don't check for embedded newlines.
+            write(s) ;
+            return ;
+        }
         for ( int i = 0 ; i < s.length() ; i++ )
             printOneChar(s.charAt(i)) ;
     }



Mime
View raw message