Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2005-07-31 22:32:59 +0000
committerslewis2005-07-31 22:32:59 +0000
commit5aff7438f52d53d0984243bc3214c72553e08d6d (patch)
tree1f70228e5bc485b7d8f72935f20f1a52dd183a65
parentbf5c9d748135092929b12ad51add11851492416b (diff)
downloadorg.eclipse.ecf-5aff7438f52d53d0984243bc3214c72553e08d6d.tar.gz
org.eclipse.ecf-5aff7438f52d53d0984243bc3214c72553e08d6d.tar.xz
org.eclipse.ecf-5aff7438f52d53d0984243bc3214c72553e08d6d.zip
Added makeID(String namespacename, URI id) to IIDFactory interface and IDFactory default implementation
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/identity/IDFactory.java15
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/identity/IIDFactory.java15
2 files changed, 26 insertions, 4 deletions
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/identity/IDFactory.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/identity/IDFactory.java
index 4b285cae6..e33bee79a 100644
--- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/identity/IDFactory.java
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/identity/IDFactory.java
@@ -251,17 +251,24 @@ public class IDFactory implements IIDFactory {
return makeID(n, args);
}
/* (non-Javadoc)
+ * @see org.eclipse.ecf.core.identity.IIDFactory#makeID(java.lang.String, java.net.URI)
+ */
+ public ID makeID(String namespacename, URI uri) throws IDInstantiationException {
+ if (uri == null) throw new IDInstantiationException("Null uri not allowed");
+ Namespace n = getNamespaceByName(namespacename);
+ if (n == null) throw new IDInstantiationException("Namespace "+n+" not found");
+ return makeID(n,new Object[] { uri });
+ }
+
+ /* (non-Javadoc)
* @see org.eclipse.ecf.core.identity.IIDFactory#makeID(java.net.URI)
*/
public ID makeID(URI uri) throws IDInstantiationException {
if (uri == null) throw new IDInstantiationException("Null uri not allowed");
String scheme = uri.getScheme();
- Namespace n = getNamespaceByName(scheme);
- if (n == null) throw new IDInstantiationException("Namespace "+scheme+" not found");
- return makeID(n,new Object[] { uri });
+ return makeID(scheme,uri);
}
-
/* (non-Javadoc)
* @see org.eclipse.ecf.core.identity.IIDFactory#makeStringID(java.lang.String)
*/
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/identity/IIDFactory.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/identity/IIDFactory.java
index 6512c1a48..6ebb4072e 100644
--- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/identity/IIDFactory.java
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/identity/IIDFactory.java
@@ -139,6 +139,21 @@ public interface IIDFactory {
*/
public ID makeID(URI uri) throws IDInstantiationException;
+ /**
+ * Make a new identity instance from a namespace name and URI.
+ *
+ * @param namespacename the name of the namespace to use to make the ID
+ * @param uri
+ * the URI to use to make ID.
+ * @param args
+ * an Object [] of the args for the ID instance constructor
+ * @exception Exception
+ * thrown if class for instantiator or iD instance can't be
+ * loaded, if something goes wrong during instance
+ * construction
+ */
+ public ID makeID(String namespacename, URI uri) throws IDInstantiationException;
+
public ID makeStringID(String idstring) throws IDInstantiationException;
public ID makeLongID(Long l) throws IDInstantiationException;

Back to the top