|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metamatrix.core.id.IDGenerator
public class IDGenerator
IDGenerator
Constructor Summary | |
---|---|
IDGenerator()
|
Method Summary | |
---|---|
void |
addBuiltInFactories()
Method that creates and adds to this generator all the built-in factories, and if there is no default factory, set the default factory to the UUIDFactory . |
void |
addFactory(ObjectIDFactory factory)
Supply to this generator a new factory for a type of ObjectID . |
ObjectID |
create()
Create a new ObjectID using the default factory |
ObjectID |
create(java.lang.String protocol)
Create a new ObjectID for the type specified by the protocol |
ObjectIDFactory |
getDefaultFactory()
Get the factory that is used by default for the create() method is invoked. |
java.util.Collection |
getFactories()
Method to obtain the collection of ObjectIDFactory instances that each describe
one of the types of ObjectID s that are available to this generator. |
ObjectIDFactory |
getFactory(java.lang.String protocol)
Method to obtain the collection of ObjectIDFactory instances that each describe
one of the types of ObjectID s that are available to this generator. |
static IDGenerator |
getInstance()
Obtain the shared instance of this class. |
java.util.Set |
getProtocols()
Method to obtain the set of String protocols. |
boolean |
hasDefaultFactory()
Return whether there is a factory that is used by default for the create() method is invoked. |
boolean |
removeFactory(java.lang.String protocol)
Remove a factory from this generator. |
void |
setDefaultFactory(ObjectIDFactory factory)
Set the factory that should be used by default for the create() method is invoked. |
void |
setDefaultFactory(java.lang.String protocol)
Set the factory that should be used by default for the create() method is invoked. |
ObjectID |
stringToObject(java.lang.String id)
Attempt to convert the specified string to the appropriate ObjectID instance. |
ObjectID |
stringToObject(java.lang.String id,
char delim)
Attempt to convert the specified string to the appropriate ObjectID instance. |
ObjectID |
stringToObject(java.lang.String id,
java.lang.String protocol)
Attempt to convert the specified string to the appropriate ObjectID instance. |
java.lang.String |
toString(ObjectID id)
Convenience method for obtaining the stringified form of an ObjectID. |
java.lang.String |
toString(ObjectID id,
char delim)
Convenience method for obtaining the stringified form of an ObjectID. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IDGenerator()
Method Detail |
---|
public static IDGenerator getInstance()
public void addBuiltInFactories()
UUIDFactory
.
This method may be called multiple times without side effect.
public void addFactory(ObjectIDFactory factory)
ObjectID
.
This method has no effect if the factory is null, or if this generator already knows
about the factory.
factory
- the new factorypublic boolean removeFactory(java.lang.String protocol)
protocol
- the protocol for which the factory is to be removed
public java.util.Collection getFactories()
ObjectIDFactory
instances that each describe
one of the types of ObjectID
s that are available to this generator.
ObjectIDFactory
instances.public ObjectIDFactory getFactory(java.lang.String protocol)
ObjectIDFactory
instances that each describe
one of the types of ObjectID
s that are available to this generator.
ObjectIDFactory
instances.public java.util.Set getProtocols()
String
protocols. This is a utility that merely obtains the
protocols from the factories.
public boolean hasDefaultFactory()
create()
method is invoked.
public ObjectIDFactory getDefaultFactory()
create()
method is invoked.
public void setDefaultFactory(ObjectIDFactory factory)
create()
method is invoked.
factory
- the factory that should be used by default; may be null if no default is to be allowed.public void setDefaultFactory(java.lang.String protocol)
create()
method is invoked.
protocol
- the protocol for factory that should be used by default; may be null if no default
is to be allowed.public ObjectID create()
ObjectID
using the default factory
public ObjectID create(java.lang.String protocol)
ObjectID
for the type specified by the protocol
protocol
- the protocol of the type of ObjectID
to be created; may not be null
public java.lang.String toString(ObjectID id)
id
-
public java.lang.String toString(ObjectID id, char delim)
id
-
public ObjectID stringToObject(java.lang.String id) throws InvalidIDException
id
- the stringified id of the form protocol:value
, where
protocol
defines the protocol of the ID, and value
Returns:InvalidIDException
- if the specified string does not contain a valid ObjectID
or if the protocol is unknownpublic ObjectID stringToObject(java.lang.String id, java.lang.String protocol) throws InvalidIDException
id
- the stringified id of the form protocol:value
, where
protocol
defines the protocol of the ID, and value
Returns:InvalidIDException
- if the specified string does not contain a valid ObjectID
or if the protocol is unknownpublic ObjectID stringToObject(java.lang.String id, char delim) throws InvalidIDException
id
- the stringified id of the form protocol:value
, where
protocol
defines the protocol of the ID, and value
Returns:InvalidIDException
- if the specified string does not contain a valid ObjectID
or if the protocol is unknown
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |