blob: 02564e3ccbb5b99db1896dfcdef0e5e915d22427 [file] [log] [blame]
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.eclipse.ecf.identity">
<annotation>
<appInfo>
<meta.schema plugin="org.eclipse.ecf.identity" id="namespace" name="ECF Namespace"/>
</appInfo>
<documentation>
Extension point that allows other plugins to define new Namespaces. Namespaces are used by the IDFactory for creating new ID instances. Plugins may define extension Namespace implementation, which will then be used to construct ID instances within than Namespace when clients use the default ECF identity factory (accessed via org.eclipse.ecf.core.identity.IDFactory.getDefault()).
&lt;p&gt;
Plugins implementing this extension point must define a Namespace class that extends &lt;b&gt;org.eclipse.ecf.core.identity.Namespace&lt;/b&gt;. 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.
</documentation>
</annotation>
<element name="extension">
<complexType>
<sequence>
<element ref="namespace" minOccurs="1" maxOccurs="unbounded"/>
</sequence>
<attribute name="point" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="id" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="name" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
</complexType>
</element>
<element name="namespace">
<annotation>
<documentation>
Element allowing plugins to define new ECF Namespaces. Plugins wishing to define new Namespaces must provide an extension of this extension point.
</documentation>
</annotation>
<complexType>
<attribute name="name" type="string">
<annotation>
<documentation>
Optional name for new Namespace. If not provided, the name will be assumed to be the value provided by the &apos;class&apos; attribute for this extension point. Note that this name must &lt;b&gt;not&lt;/b&gt; conflict with any other Namespace name in the ECF IDFactory in order to be successfully registered. Care should therefore be taken in selection of a namespace name such that it does not conflict with other implementations.
</documentation>
</annotation>
</attribute>
<attribute name="class" type="string" use="required">
<annotation>
<documentation>
The fully qualified name of a class that extends &lt;b&gt;org.eclipse.ecf.core.identity.Namespace&lt;/b&gt;.
</documentation>
<appInfo>
<meta.attribute kind="java" basedOn="org.eclipse.ecf.core.identity.Namespace"/>
</appInfo>
</annotation>
</attribute>
<attribute name="description" type="string">
<annotation>
<documentation>
An optional description for the Namespace extension
</documentation>
</annotation>
</attribute>
</complexType>
</element>
<annotation>
<appInfo>
<meta.section type="since"/>
</appInfo>
<documentation>
0.4.0
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="examples"/>
</appInfo>
<documentation>
Here&apos;s an extension definition that associates an namespace class with namespace &apos;testid&apos;:
&lt;pre&gt;
&lt;extension point=&quot;org.eclipse.ecf.identity.namespace&quot;&gt;
&lt;namespace name=&quot;testnamespace&quot; class=&quot;org.eclipse.ecf.test.FooNamespace&quot; description=&quot;my namespace implementation&quot;/&gt;
&lt;/extension&gt;
&lt;/pre&gt;
Here is some example code to implement this FooNamespace class:
&lt;pre&gt;
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]);
}
}
&lt;/pre&gt;
In this example, the FooNamespace class implements the abstract &lt;b&gt;Namesapce&lt;/b&gt;.createInstance method by creating and returning a new instance of FooID, a class also defined by the extension plugin. This class must implement &lt;b&gt;ID&lt;/b&gt;, so that it can successfully be returned from the Namespace.createInstance call.
&lt;h3&gt;Example Usage of IDFactory by Clients&lt;/h3&gt;
Clients that wish to use the &apos;testnamespace&apos; Namespace implementation can do so simply by making the following call to create an &lt;b&gt;IDFactory&lt;/b&gt;:
&lt;pre&gt;
ID newID = IDFactory.getDefault().createID(&quot;testnamespace&quot;,&quot;email@emailserver.com&quot;);
&lt;/pre&gt;
Another example would be:
&lt;pre&gt;
ID newID = IDFactory.getDefault().createID(new URI(&quot;testnamespace:email@emailserver.com&quot;));
&lt;/pre&gt;
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="apiInfo"/>
</appInfo>
<documentation>
The client API for this extension point is provided by the &lt;b&gt;org.eclipse.ecf.core.IIDFactory.createID&lt;/b&gt; methods. A valid IIDFactory is provided by the by the static &lt;b&gt;org.eclipse.ecf.core.identityIDFactory.getDefault()&lt;/b&gt; method.
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="implementation"/>
</appInfo>
<documentation>
The following implementations of this extension point are provided by ECF itself:
&lt;p&gt;
StringID -- A namespace of ID instances that are implemented by &lt;b&gt;org.eclipse.ecf.core.identity.StringID&lt;/b&gt;
&lt;p&gt;Clients may use this namespace with calls to:
&lt;pre&gt;
ID newID = org.eclipse.ecf.core.identity.IDFactory.createStringID(&apos;idstringvalue&apos;);
&lt;/pre&gt;
&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;
LongID -- A namespace of ID instances that are implemented by &lt;b&gt;org.eclipse.ecf.core.identity.LongID&lt;/b&gt;
&lt;p&gt;Clients may use this namespace with calls to:
&lt;pre&gt;
ID newID = org.eclipse.ecf.core.identity.IDFactory.createLongID(2004L);
&lt;/pre&gt;
&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;
GUID -- A namespace of ID instances that are implemented by &lt;b&gt;org.eclipse.ecf.core.identity.GUID&lt;/b&gt;
&lt;p&gt;Clients may use this namespace with calls to:
&lt;pre&gt;
ID newID = org.eclipse.ecf.core.identity.IDFactory.createGUID(16);
&lt;/pre&gt;
&lt;/p&gt;
&lt;/p&gt;
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="copyright"/>
</appInfo>
<documentation>
Copyright (c) 2004 Composent, Inc. and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Composent, Inc. - initial API and implementation
</documentation>
</annotation>
</schema>