jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [33/41] jena git commit: Some comments.
Date Mon, 03 Oct 2016 10:36:05 GMT
Some comments.

Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/8d1e0a3b
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/8d1e0a3b
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/8d1e0a3b

Branch: refs/heads/master
Commit: 8d1e0a3b6a59dbaf7243646dfc40edd9856c9d65
Parents: 670e700
Author: Andy Seaborne <andy@apache.org>
Authored: Fri Sep 23 13:21:15 2016 +0100
Committer: Andy Seaborne <andy@apache.org>
Committed: Sun Oct 2 11:54:05 2016 +0100

----------------------------------------------------------------------
 .../apache/jena/riot/system/StreamRDFLib.java   | 62 +++++++++++++++-----
 1 file changed, 47 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/8d1e0a3b/jena-arq/src/main/java/org/apache/jena/riot/system/StreamRDFLib.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/system/StreamRDFLib.java b/jena-arq/src/main/java/org/apache/jena/riot/system/StreamRDFLib.java
index 3058d8c..4892049 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/system/StreamRDFLib.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/system/StreamRDFLib.java
@@ -41,29 +41,61 @@ public class StreamRDFLib
     /** Send everything to nowhere ... efficiently */
     public static StreamRDF sinkNull()                       { return new StreamRDFBase()
; }
 
+    /**
+     * Create a {@link StreamRDF} that outputs to an {@link OutputStream}. It is important
+     * to call {@link StreamRDF#start} and {@link StreamRDF#finish} because the output is
+     * buffered.
+     */
     public static StreamRDF writer(OutputStream out)         { return new WriterStreamRDFPlain(IO.wrapUTF8(out))
; }
+    
+    /** Create a {@link StreamRDF} that outputs to an {@link AWriter}. */
     public static StreamRDF writer(AWriter out)              { return new WriterStreamRDFPlain(out)
; }
+    
+    /**
+     * Create a {@link StreamRDF} that outputs to an {@link Writer}. It is important to
+     * call {@link StreamRDF#start} and {@link StreamRDF#finish} because the output is
+     * buffered.
+     */
     public static StreamRDF writer(Writer out)               { return new WriterStreamRDFPlain(IO.wrap(out))
; }
     
-    public static StreamRDF writer(OutputStream out, CharSpace charSpace)
-    {
+    /**
+     * Create a {@link StreamRDF} that outputs to an {@link OutputStream} with a specific
+     * {@link CharSpace} (ASCII or UTF-8).
+     * <p>
+     * It is important to call {@link StreamRDF#start}
+     * and {@link StreamRDF#finish} because the output is buffered.
+     */
+    public static StreamRDF writer(OutputStream out, CharSpace charSpace) {
         switch (charSpace) {
-        case ASCII:
-            return new WriterStreamRDFPlain(IO.wrapASCII(out), charSpace);
-        case UTF8:
-        default:
-            return writer(out);
+            case ASCII :
+                return new WriterStreamRDFPlain(IO.wrapASCII(out), charSpace) ;
+            case UTF8 :
+            default :
+                return writer(out) ;
         }
     }
-    
-    public static StreamRDF writer(AWriter out, CharSpace charSpace)
-    {
-        return new WriterStreamRDFPlain(out, charSpace);
+
+    /**
+     * Create a {@link StreamRDF} that outputs to an {@link OutputStream} with a specific
+     * {@link CharSpace} (ASCII or UTF-8).
+     * <p>
+     * It is important to call {@link StreamRDF#start}
+     * and {@link StreamRDF#finish} because the output is buffered.
+     */
+    public static StreamRDF writer(AWriter out, CharSpace charSpace) {
+        return new WriterStreamRDFPlain(out, charSpace) ;
     }
-    
-    public static StreamRDF writer(Writer out, CharSpace charSpace)
-    {
-        return new WriterStreamRDFPlain(IO.wrap(out), charSpace);
+
+    /**
+     * Create a {@link StreamRDF} that outputs to an {@link Writer} with a specific
+     * {@link CharSpace} (ASCII or UTF-8) writing out-of-range codepoints (if ASCII)
+     * as "\ uXXXX".
+     * <p>
+     * It is important to call {@link StreamRDF#start}
+     * and {@link StreamRDF#finish} because the output is buffered.
+     */
+    public static StreamRDF writer(Writer out, CharSpace charSpace) {
+        return new WriterStreamRDFPlain(IO.wrap(out), charSpace) ;
     }
 
     public static StreamRDF graph(Graph graph)               { return new ParserOutputGraph(graph)
; }


Mime
View raw message