|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.ecf.provider.jslp.container.ContainerInstantiator
public class ContainerInstantiator
Constructor Summary | |
---|---|
ContainerInstantiator()
|
Method Summary | |
---|---|
IContainer |
createInstance(ContainerTypeDescription description,
java.lang.Object[] args)
Create instance of IContainer. |
java.lang.String[] |
getSupportedAdapterTypes(ContainerTypeDescription description)
Get array of supported adapters for the given container type description. |
java.lang.String[] |
getSupportedIntents(ContainerTypeDescription description)
|
java.lang.Class[][] |
getSupportedParameterTypes(ContainerTypeDescription description)
Get array of parameter types for given container type description. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ContainerInstantiator()
Method Detail |
---|
public IContainer createInstance(ContainerTypeDescription description, java.lang.Object[] args) throws ContainerCreateException
IContainerInstantiator
ContainerFactory.getDefault().createContainer("foocontainer",new Object { "hello" });
createInstance
in interface IContainerInstantiator
description
- the ContainerTypeDescription associated with the registered
container provider implementationargs
- parameters specified by the caller. May be null if no
parameters are passed in by caller to
ContainerFactory.getDefault().createContainer(...)
ContainerCreateException
public java.lang.String[] getSupportedAdapterTypes(ContainerTypeDescription description)
IContainerInstantiator
IContainer.getAdapter(Class)
with the same type name as a
returned value will return a non-null
result. In other
words, even if the class name is in the returned array, subsequent calls
to IContainer.getAdapter(Class)
may still return
null
.
getSupportedAdapterTypes
in interface IContainerInstantiator
description
- the ContainerTypeDescription to report adapters for. Must not
be null
.
null
may be returned by
the provider if no adapters are supported for this description.public java.lang.Class[][] getSupportedParameterTypes(ContainerTypeDescription description)
IContainerInstantiator
IContainerInstantiator.createInstance(ContainerTypeDescription, Object[])
.
Each of the rows of the returned array specifies a Class[] of parameter types. These parameter types correspond to the types of Object[] that can be passed into the second parameter of
IContainerInstantiator.createInstance(ContainerTypeDescription, Object[])
.
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
IContainerInstantiator.createInstance(ContainerTypeDescription, Object[])
:
1) a single String, and 2) two Strings. These would therefore be
acceptable as input to createInstance:
IContainer container = ContainerFactory.getDefault().createContainer( description, new Object[] { "Hello" }); IContainer container2 = ContainerFactory.getDefault().createContainer( description, new Object[] { "Hello" });
getSupportedParameterTypes
in interface IContainerInstantiator
description
- the ContainerTypeDescription to return parameter types for
IContainerInstantiator.createInstance(ContainerTypeDescription, Object[])
.
null
returned if no parameter types supported for
given description.public java.lang.String[] getSupportedIntents(ContainerTypeDescription description)
getSupportedIntents
in interface IContainerInstantiator
description
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |