Class RestNamespace
- java.lang.Object
-
- org.eclipse.ecf.core.identity.Namespace
-
- org.eclipse.ecf.remoteservice.rest.identity.RestNamespace
-
- All Implemented Interfaces:
Serializable
,org.eclipse.core.runtime.IAdaptable
public class RestNamespace extends Namespace
This class represents aNamespace
forRestClientContainer
s.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RestNamespace()
RestNamespace(String name, String desc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ID
createInstance(Object[] parameters)
Creates an instance of anRestID
.String
getScheme()
Get the primary scheme associated with this namespace.Class[][]
getSupportedParameterTypes()
Get the supported parameter types for IDs created via subsequent calls toNamespace.createInstance(Object[])
.-
Methods inherited from class org.eclipse.ecf.core.identity.Namespace
equals, getAdapter, getCompareToForObject, getDescription, getHashCodeForID, getInitStringFromExternalForm, getName, getNameForID, getSupportedSchemes, hashCode, initialize, testIDEquals, toExternalForm, toString
-
-
-
-
Field Detail
-
INSTANCE
public static Namespace INSTANCE
- Since:
- 2.7
-
NAME
public static final String NAME
The name of this namespace.- See Also:
- Constant Field Values
-
SCHEME
public static final String SCHEME
The scheme of this namespace.- See Also:
- Constant Field Values
-
-
Method Detail
-
createInstance
public ID createInstance(Object[] parameters) throws IDCreateException
Creates an instance of anRestID
. The parameters must contain specific information.- Specified by:
createInstance
in classNamespace
- Parameters:
parameters
- a collection of attributes to call the right constructor onRestID
.- Returns:
- an instance of
RestID
. Will not benull
. - Throws:
IDCreateException
- if construction fails
-
getScheme
public String getScheme()
Description copied from class:Namespace
Get the primary scheme associated with this namespace. Subclasses must provide an implementation that returns a non-null
scheme identifier. Note that the returned scheme should not contain the Namespace.SCHEME_SEPARATOR (\":\").
-
getSupportedParameterTypes
public Class[][] getSupportedParameterTypes()
Description copied from class:Namespace
Get the supported parameter types for IDs created via subsequent calls toNamespace.createInstance(Object[])
. Callers may use this method to determine the available parameter types, and then create and pass in conforming Object arrays to toNamespace.createInstance(Object[])
.Namespace.createInstance(Object[])
will be ignored.Namespace.createInstance(Object[])
. The rows of the returned Class array are the acceptable types for a given invocation of createInstance.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 intoNamespace.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"}};
- Overrides:
getSupportedParameterTypes
in classNamespace
- Returns:
- Class [][] an array of class []s. Rows of the returned
two-dimensional array define the acceptable parameter types for a
single call to
Namespace.createInstance(Object[])
. If zero-length Class arrays are returned (i.e. Class[0][0]), then Object [] parameters toNamespace.createInstance(Object[])
will be ignored.
-
-