Plugins implementing this extension point must define a Namespace class that extends org.eclipse.ecf.core.identity.Namespace. The class attribute of the namespace extension must provide a valid Namespace subclass. The name attribute defines the namespace name. If the name attribute is not present, then the Namespace class will be used as the Namespace name. The optional description attribute is an optional arbitrary description for the Namespace.
<!ELEMENT extension (namespace+)>
<!ATTLIST extension
point CDATA #REQUIRED
id CDATA #IMPLIED
name CDATA #IMPLIED>
<!ELEMENT namespace EMPTY>
<!ATTLIST namespace
name CDATA #IMPLIED
class CDATA #REQUIRED
description CDATA #IMPLIED>
Element allowing plugins to define new ECF Namespaces. Plugins wishing to define new Namespaces must provide an extension of this extension point.
<extension point="org.eclipse.ecf.identity.namespace"> <namespace name="testnamespace" class="org.eclipse.ecf.test.FooNamespace" description="my namespace implementation"/> </extension>Here is some example code to implement this FooNamespace class:
package org.eclipse.ecf.test;
import org.eclipse.ecf.core.identity.ID;
import org.eclipse.ecf.core.identity.IDCreateException;
import org.eclipse.ecf.core.identity.Namespace;
public class FooNamespace extends
org.eclipse.ecf.core.identity.Namespace {
public ID createInstance(Class[] argTypes, Object[] args)
throws IDCreateException {
return new FooID((String) args[0]);
}
}
In this example, the FooNamespace class implements the abstract Namesapce.createInstance method by creating and returning a new instance of FooID, a class also defined by the extension plugin. This class must implement ID, so that it can successfully be returned from the Namespace.createInstance call.
ID newID = IDFactory.getDefault().createID("testnamespace","email@emailserver.com");
Another example would be:
ID newID = IDFactory.getDefault().createID(new URI("testnamespace:email@emailserver.com"));
StringID -- A namespace of ID instances that are implemented by org.eclipse.ecf.core.identity.StringID
Clients may use this namespace with calls to:
ID newID = org.eclipse.ecf.core.identity.IDFactory.createStringID('idstringvalue');
LongID -- A namespace of ID instances that are implemented by org.eclipse.ecf.core.identity.LongID
Clients may use this namespace with calls to:
ID newID = org.eclipse.ecf.core.identity.IDFactory.createLongID(2004L);
GUID -- A namespace of ID instances that are implemented by org.eclipse.ecf.core.identity.GUID
Clients may use this namespace with calls to:
ID newID = org.eclipse.ecf.core.identity.IDFactory.createGUID(16);
Copyright (c) 2004 Composent, Inc. and others. This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at https://www.eclipse.org/legal/epl-2.0/ SPDX-License-Identifier: EPL-2.0