|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.ecf.core.identity.IDFactory
public class IDFactory
A factory class for creating ID instances. This is the factory for plugins to manufacture ID instances.
Field Summary | |
---|---|
protected static IIDFactory |
instance
|
static java.lang.String |
SECURITY_PROPERTY
|
Method Summary | |
---|---|
Namespace |
addNamespace(Namespace namespace)
Add the given Namespace to our table of available Namespaces |
static Namespace |
addNamespace0(Namespace namespace)
|
protected static void |
checkPermission(NamespacePermission namespacepermission)
|
boolean |
containsNamespace(Namespace namespace)
Check whether table contains given Namespace instance |
static boolean |
containsNamespace0(Namespace n)
|
ID |
createGUID()
Make a GUID using SHA-1 hash algorithm and a default of 16bits of data length. |
ID |
createGUID(int length)
Make a GUID using SHA-1 hash algorithm and a default of 16bits of data length. |
ID |
createID(Namespace n,
java.lang.Object[] args)
Make a new identity. |
ID |
createID(Namespace namespace,
java.lang.String uri)
Make a new identity instance from a namespace and String. |
ID |
createID(java.lang.String namespaceName,
java.lang.Object[] args)
Make a new identity. |
ID |
createID(java.lang.String namespace,
java.lang.String uri)
Make a new identity instance from a namespaceName and idValue. |
ID |
createLongID(long l)
Make a an ID from a long |
ID |
createStringID(java.lang.String idstring)
Make a an ID from a String |
static IIDFactory |
getDefault()
|
Namespace |
getNamespace(Namespace namespace)
Get the given Namespace instance from table |
protected static Namespace |
getNamespace0(Namespace n)
|
protected static Namespace |
getNamespace0(java.lang.String name)
|
Namespace |
getNamespaceByName(java.lang.String name)
Get a Namespace instance by its string name. |
java.util.List |
getNamespaces()
Get a list of the current Namespace instances exposed by this factory. |
protected static void |
logAndThrow(java.lang.String s,
java.lang.Throwable t)
|
Namespace |
removeNamespace(Namespace n)
Remove the given Namespace from our table of available Namespaces |
protected static Namespace |
removeNamespace0(Namespace n)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SECURITY_PROPERTY
protected static IIDFactory instance
Method Detail |
---|
public static IIDFactory getDefault()
public Namespace addNamespace(Namespace namespace) throws java.lang.SecurityException
IIDFactory
addNamespace
in interface IIDFactory
namespace
- the Namespace to add
java.lang.SecurityException
- thrown if caller does not have appropriate
NamespacePermission for given namespacepublic static final Namespace addNamespace0(Namespace namespace)
protected static final void checkPermission(NamespacePermission namespacepermission) throws java.lang.SecurityException
java.lang.SecurityException
public boolean containsNamespace(Namespace namespace) throws java.lang.SecurityException
IIDFactory
containsNamespace
in interface IIDFactory
namespace
- the Namespace to look for
java.lang.SecurityException
- thrown if caller does not have appropriate
NamespacePermission for given namespacepublic java.util.List getNamespaces()
IIDFactory
getNamespaces
in interface IIDFactory
public static final boolean containsNamespace0(Namespace n)
public Namespace getNamespace(Namespace namespace) throws java.lang.SecurityException
IIDFactory
getNamespace
in interface IIDFactory
namespace
- the Namespace to look for
java.lang.SecurityException
- thrown if caller does not have appropriate
NamespacePermission for given namespacepublic Namespace getNamespaceByName(java.lang.String name) throws java.lang.SecurityException
IIDFactory
getNamespaceByName
in interface IIDFactory
name
- the name to use for lookup
java.lang.SecurityException
- thrown if caller does not have appropriate
NamespacePermission for given namespaceprotected static final Namespace getNamespace0(Namespace n)
protected static final Namespace getNamespace0(java.lang.String name)
public ID createGUID() throws IDCreateException
IIDFactory
createGUID
in interface IIDFactory
IDCreateException
- if ID cannot be constructedpublic ID createGUID(int length) throws IDCreateException
IIDFactory
createGUID
in interface IIDFactory
length
- the byte-length of data used to create a GUID
IDCreateException
- if ID cannot be constructedprotected static void logAndThrow(java.lang.String s, java.lang.Throwable t) throws IDCreateException
IDCreateException
public ID createID(Namespace n, java.lang.Object[] args) throws IDCreateException
IIDFactory
createID
in interface IIDFactory
n
- the Namespace to which the ID will belongargs
- an Object [] of the parameters for the ID instance constructor
IDCreateException
- thrown if class for instantiator or instance can't be
loaded, if something goes wrong during instance
constructionpublic ID createID(java.lang.String namespaceName, java.lang.Object[] args) throws IDCreateException
IIDFactory
createID
in interface IIDFactory
namespaceName
- the name of the Namespace to which the ID will belongargs
- an Object [] of the parameters for the ID instance constructor
IDCreateException
- thrown if class for instantiator or ID instance can't be
loaded, if something goes wrong during instance
constructionpublic ID createID(Namespace namespace, java.lang.String uri) throws IDCreateException
IIDFactory
createID
in interface IIDFactory
namespace
- the namespace to use to create the IDuri
- the String uri to use to create the ID
IDCreateException
- thrown if class for instantiator or ID instance can't be
loaded, if something goes wrong during instance
constructionpublic ID createID(java.lang.String namespace, java.lang.String uri) throws IDCreateException
IIDFactory
IIDFactory.getNamespaceByName(String)
, and then the result is passed into
IIDFactory.createID(Namespace,String)
.
createID
in interface IIDFactory
namespace
- the name of the namespace that should be used to create the IDuri
- the String value to use to create the ID
IDCreateException
- thrown if class for instantiator or ID instance can't be
loaded, if something goes wrong during instance
constructionpublic ID createStringID(java.lang.String idstring) throws IDCreateException
IIDFactory
createStringID
in interface IIDFactory
idstring
- the String to use as this ID's unique value. Note: It is
incumbent upon the caller of this method to be sure that the
given string allows the resulting ID to satisfy the ID
contract for global uniqueness within the associated
Namespace.
IDCreateException
- thrown if class for instantiator or ID instance can't be
loaded, if something goes wrong during instance constructionpublic ID createLongID(long l) throws IDCreateException
IIDFactory
createLongID
in interface IIDFactory
l
- the long to use as this ID's unique value. Note: It is
incumbent upon the caller of this method to be sure that the
given long allows the resulting ID to satisfy the ID contract
for global uniqueness within the associated Namespace.
IDCreateException
- thrown if class for instantiator or ID instance can't be
loaded, if something goes wrong during instance constructionpublic Namespace removeNamespace(Namespace n) throws java.lang.SecurityException
IIDFactory
removeNamespace
in interface IIDFactory
n
- the Namespace to remove
java.lang.SecurityException
- thrown if caller does not have appropriate
NamespacePermission for given namespaceprotected static final Namespace removeNamespace0(Namespace n)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |