Always go through a fixed point of the object's "put" method. Project: http://git-wip-us.apache.org/repos/asf/jena/repo Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/859c0f24 Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/859c0f24 Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/859c0f24
Branch: refs/heads/master Commit: 859c0f247ffa83b0c3964466cee86d6742c8c804 Parents: 6d47d54 Author: Andy Seaborne <[email protected]> Authored: Wed Mar 9 20:10:12 2016 +0000 Committer: Andy Seaborne <[email protected]> Committed: Wed Mar 9 20:10:12 2016 +0000 ---------------------------------------------------------------------- .../jena/sparql/function/FunctionRegistry.java | 19 ++++++++++--------- .../pfunction/PropertyFunctionRegistry.java | 18 +++++++++--------- 2 files changed, 19 insertions(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/jena/blob/859c0f24/jena-arq/src/main/java/org/apache/jena/sparql/function/FunctionRegistry.java ---------------------------------------------------------------------- diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/FunctionRegistry.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/FunctionRegistry.java index 26cce62..22593ad 100644 --- a/jena-arq/src/main/java/org/apache/jena/sparql/function/FunctionRegistry.java +++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/FunctionRegistry.java @@ -69,13 +69,7 @@ public class FunctionRegistry //extends HashMap<String, Function> public FunctionRegistry() {} - /** Insert a function. Re-inserting with the same URI overwrites the old entry. - * - * @param uri - * @param f - */ - public void put(String uri, FunctionFactory f) { registry.put(uri,f) ; } - + /** Insert a class that is the function implementation * * @param uri String URI @@ -89,9 +83,16 @@ public class FunctionRegistry //extends HashMap<String, Function> return ; } - registry.put(uri, new FunctionFactoryAuto(funcClass)) ; + put(uri, new FunctionFactoryAuto(funcClass)) ; } - + + /** Insert a function. Re-inserting with the same URI overwrites the old entry. + * + * @param uri + * @param f + */ + public void put(String uri, FunctionFactory f) { registry.put(uri,f) ; } + /** Lookup by URI */ public FunctionFactory get(String uri) { http://git-wip-us.apache.org/repos/asf/jena/blob/859c0f24/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/PropertyFunctionRegistry.java ---------------------------------------------------------------------- diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/PropertyFunctionRegistry.java b/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/PropertyFunctionRegistry.java index 561b992..c0f218c 100644 --- a/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/PropertyFunctionRegistry.java +++ b/jena-arq/src/main/java/org/apache/jena/sparql/pfunction/PropertyFunctionRegistry.java @@ -79,14 +79,6 @@ public class PropertyFunctionRegistry } - /** Insert an PropertyFunction factory. Re-inserting with the same URI - * overwrites the old entry. - * - * @param uri String URI for the PropertyFunction - * @param factory Factory to make PropertyFunction instances - */ - public void put(String uri, PropertyFunctionFactory factory) { registry.put(uri,factory) ; } - /** Insert an PropertyFunction class. * Re-inserting with the same URI overwrites the old entry. * New instance created on retrieval (auto-factory) @@ -102,9 +94,17 @@ public class PropertyFunctionRegistry return ; } - registry.put(uri,new PropertyFunctionFactoryAuto(extClass)) ; + put(uri,new PropertyFunctionFactoryAuto(extClass)) ; } + /** Insert an PropertyFunction factory. Re-inserting with the same URI + * overwrites the old entry. + * + * @param uri String URI for the PropertyFunction + * @param factory Factory to make PropertyFunction instances + */ + public void put(String uri, PropertyFunctionFactory factory) { registry.put(uri,factory) ; } + public boolean manages(String uri) { if ( registry.containsKey(uri) )
