commonsrdf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject [14/36] incubator-commonsrdf git commit: more about builder pattern
Date Wed, 28 Sep 2016 13:52:06 GMT
more about builder pattern


Project: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/commit/b4342b94
Tree: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/tree/b4342b94
Diff: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/diff/b4342b94

Branch: refs/heads/master
Commit: b4342b94fa6ff992986bf6141325f97d6d6a4583
Parents: c3fd214
Author: Stian Soiland-Reyes <stain@apache.org>
Authored: Sun Apr 3 02:54:28 2016 +0100
Committer: Stian Soiland-Reyes <stain@apache.org>
Committed: Sun Apr 3 02:54:28 2016 +0100

----------------------------------------------------------------------
 .../org/apache/commons/rdf/api/RDFParserBuilder.java    | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/b4342b94/api/src/main/java/org/apache/commons/rdf/api/RDFParserBuilder.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/commons/rdf/api/RDFParserBuilder.java b/api/src/main/java/org/apache/commons/rdf/api/RDFParserBuilder.java
index 03dcc48..bc7d750 100644
--- a/api/src/main/java/org/apache/commons/rdf/api/RDFParserBuilder.java
+++ b/api/src/main/java/org/apache/commons/rdf/api/RDFParserBuilder.java
@@ -29,8 +29,16 @@ import java.util.concurrent.Future;
  * This interface follows the
  * <a href="https://en.wikipedia.org/wiki/Builder_pattern">Builder pattern</a>,
  * allowing to set parser settings like {@link #contentType(RDFSyntax)} and
- * {@link #base(IRI)}. A caller MUST call one of the {@link #source(IRI)}
- * methods before calling {@link #parse()} on the returned RDFParserBuilder.
+ * {@link #base(IRI)}. A caller MUST call one of the <code>source</code> methods
+ * (e.g. {@link #source(IRI)}, {@link #source(Path)},
+ * {@link #source(InputStream)}) before calling {@link #parse()} on the returned
+ * RDFParserBuilder - however methods can be called in any order.
+ * <p>
+ * Setting a method that has already been set will override any existing value
+ * in the returned builder - irregardless of the parameter type (e.g.
+ * {@link #source(IRI)} will override a previous {@link #source(Path)}. Settings
+ * can be unset by passing <code>null</code> - this may require casting, e.g.
+ * <code>contentType( (RDFSyntax) null )</code>.
  * <p>
  * It is undefined if a RDFParserBuilder is mutable or thread-safe, so callers
  * should always use the returned modified RDFParserBuilder from the builder


Mime
View raw message