public class R_OSGiNamespace extends Namespace
Modifier and Type | Field and Description |
---|---|
static String |
NAME |
static String |
NAMESPACE_SCHEME
the namespace scheme.
|
SCHEME_SEPARATOR
Modifier | Constructor and Description |
---|---|
|
R_OSGiNamespace()
constructor.
|
protected |
R_OSGiNamespace(String name,
String description) |
Modifier and Type | Method and Description |
---|---|
ID |
createInstance(Object[] parameters)
create a new ID within this namespace.
|
static Namespace |
getDefault()
get the singleton instance of this namespace.
|
String |
getScheme()
get the scheme of this namespace.
|
Class<?>[][] |
getSupportedParameterTypes()
Get the supported parameter types for IDs created via subsequent calls to
Namespace.createInstance(Object[]) . |
String[] |
getSupportedSchemes()
get all supported schemes.
|
equals, getAdapter, getCompareToForObject, getDescription, getHashCodeForID, getInitStringFromExternalForm, getName, getNameForID, hashCode, initialize, testIDEquals, toExternalForm, toString
public static final String NAME
public static final String NAMESPACE_SCHEME
public static Namespace getDefault()
public ID createInstance(Object[] parameters) throws IDCreateException
createInstance
in class Namespace
parameters
- the parameter to pass to the ID.IDCreateException
- if the creation fails.Namespace.createInstance(java.lang.Object[])
public String getScheme()
getScheme
in class Namespace
Namespace.getScheme()
public String[] getSupportedSchemes()
getSupportedSchemes
in class Namespace
Namespace.getSupportedSchemes()
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 © 2004–2020 Eclipse Foundation. All rights reserved.