public static class URIID.URIIDNamespace extends Namespace
Modifier and Type | Field and Description |
---|---|
static String |
UUID_PROTOCOL |
SCHEME_SEPARATOR
Constructor and Description |
---|
URIIDNamespace() |
URIIDNamespace(String name,
String desc) |
Modifier and Type | Method and Description |
---|---|
ID |
createInstance(Object[] parameters)
Make an instance of this namespace.
|
ID |
createRandomUUID() |
String |
getScheme()
Get the primary scheme associated with this namespace.
|
Class<?>[][] |
getSupportedParameterTypes()
Get the supported parameter types for IDs created via subsequent calls to
Namespace.createInstance(Object[]) . |
equals, getAdapter, getCompareToForObject, getDescription, getHashCodeForID, getInitStringFromExternalForm, getName, getNameForID, getSupportedSchemes, hashCode, initialize, testIDEquals, toExternalForm, toString
public static final String UUID_PROTOCOL
public ID createInstance(Object[] parameters) throws IDCreateException
Namespace
See
Namespace.getSupportedParameterTypes()
to get information relevant to
deciding what parameter types are expected by this method.
createInstance
in class Namespace
parameters
- an Object[] of parameters for creating ID instances. May be
null.IDCreateException
- if construction failspublic ID createRandomUUID() throws IDCreateException
IDCreateException
public String getScheme()
Namespace
null
scheme
identifier. Note that the returned scheme should not contain the
Namespace.SCHEME_SEPARATOR (\":\").public Class<?>[][] getSupportedParameterTypes()
Namespace
Namespace.createInstance(Object[])
. Callers may use this method to
determine the available parameter types, and then create and pass in
conforming Object arrays to to Namespace.createInstance(Object[])
.
An empty two-dimensional array (new Class[0][0]) is the default returned by this abstract superclass. This means that the Object [] passed to
Namespace.createInstance(Object[])
will be ignored.
Subsclasses should override this method to specify the parameters that they will accept in calls to
Namespace.createInstance(Object[])
. The rows
of the returned Class array are the acceptable types for a given
invocation of createInstance.
Consider the following example:
public Class[][] getSupportedParameterTypes() { return new Class[][] { { String.class }, { String.class, String.class } }; }The above means that there are two acceptable values for the Object [] passed into
Namespace.createInstance(Object[])
: 1) a single String, and 2)
two Strings. These would therefore be acceptable as input to
createInstance:
ID newID1 = namespace.createInstance(new Object[] { "Hello" }); ID newID2 = namespace.createInstance(new Object[] { "Hello", "There"}};
getSupportedParameterTypes
in class Namespace
Namespace.createInstance(Object[])
. If zero-length
Class arrays are returned (i.e. Class[0][0]), then Object []
parameters to Namespace.createInstance(Object[])
will be ignored.Copyright © 2017. All rights reserved.