commonsrdf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject [29/50] [abbrv] incubator-commonsrdf git commit: createRDFTermFactory method
Date Sat, 02 Jul 2016 16:14:46 GMT
createRDFTermFactory method


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

Branch: refs/heads/jena
Commit: 90293961b3cf97bd0dca38bae0edb0c239e83a5e
Parents: aa5f797
Author: Stian Soiland-Reyes <stain@apache.org>
Authored: Mon Mar 28 05:40:03 2016 +0100
Committer: Stian Soiland-Reyes <stain@apache.org>
Committed: Mon Mar 28 05:40:03 2016 +0100

----------------------------------------------------------------------
 .../apache/commons/rdf/simple/AbstractRDFParserBuilder.java   | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/90293961/simple/src/main/java/org/apache/commons/rdf/simple/AbstractRDFParserBuilder.java
----------------------------------------------------------------------
diff --git a/simple/src/main/java/org/apache/commons/rdf/simple/AbstractRDFParserBuilder.java
b/simple/src/main/java/org/apache/commons/rdf/simple/AbstractRDFParserBuilder.java
index afbe32d..a80a190 100644
--- a/simple/src/main/java/org/apache/commons/rdf/simple/AbstractRDFParserBuilder.java
+++ b/simple/src/main/java/org/apache/commons/rdf/simple/AbstractRDFParserBuilder.java
@@ -48,6 +48,7 @@ public abstract class AbstractRDFParserBuilder implements RDFParserBuilder
{
 	private static final ThreadGroup threadGroup = new ThreadGroup("Commons RDF parsers");
 	private static final ExecutorService threadpool = Executors.newCachedThreadPool(r ->
new Thread(threadGroup, r));
 
+	// Basically only used for creating IRIs
 	private static RDFTermFactory internalRdfTermFactory = new SimpleRDFTermFactory();
 
 	protected Optional<RDFTermFactory> rdfTermFactory = Optional.empty();
@@ -243,7 +244,7 @@ public abstract class AbstractRDFParserBuilder implements RDFParserBuilder
{
 
 		// Use a fresh SimpleRDFTermFactory for each parse
 		if (!c.rdfTermFactory.isPresent()) {
-			c.rdfTermFactory = Optional.of(new SimpleRDFTermFactory());
+			c.rdfTermFactory = Optional.of(createRDFTermFactory());
 		}
 		// No graph? We'll create one.
 		if (!c.intoGraph.isPresent()) {
@@ -258,6 +259,10 @@ public abstract class AbstractRDFParserBuilder implements RDFParserBuilder
{
 		return c;
 	}
 
+	protected RDFTermFactory createRDFTermFactory() {
+		return new SimpleRDFTermFactory();
+	}
+
 	@Override
 	public Future<Graph> parse() throws IOException, IllegalStateException {
 		final AbstractRDFParserBuilder c = prepareForParsing();


Mime
View raw message