public static class BaseContainer.Instantiator extends BaseContainerInstantiator
| Modifier and Type | Field and Description |
|---|---|
static String |
NAME |
EMPTY_CLASS_ARRAY, EMPTY_STRING_ARRAY, NO_ADAPTERS_ARRAY| Constructor and Description |
|---|
Instantiator() |
| Modifier and Type | Method and Description |
|---|---|
IContainer |
createInstance(ContainerTypeDescription description,
Object[] parameters)
Create instance of IContainer.
|
String[] |
getSupportedAdapterTypes(ContainerTypeDescription description)
Get array of supported adapters for the given container type description.
|
Class[][] |
getSupportedParameterTypes(ContainerTypeDescription description)
Get array of parameter types for given container type description.
|
getAdaptersForClass, getIDParameterValue, getIDParameterValue, getIDParameterValue, getIntegerFromArg, getInterfacesAndAdaptersForClass, getInterfacesForClass, getInterfacesForClass, getMap, getMapParameterString, getMapParameterString, getParameterValue, getParameterValue, getParameterValue, getParameterValue, getParameterValue, getStringFromArg, getSupportedIntentspublic static final String NAME
public IContainer createInstance(ContainerTypeDescription description, Object[] parameters) throws ContainerCreateException
IContainerInstantiatorContainerFactory.getDefault().createContainer("foocontainer",new Object { "hello" });
createInstance in interface IContainerInstantiatorcreateInstance in class BaseContainerInstantiatordescription - the ContainerTypeDescription associated with the registered
container provider implementationparameters - parameters specified by the caller. May be null if no
parameters are passed in by caller to
ContainerFactory.getDefault().createContainer(...)ContainerCreateException - thrown if instance cannot be createdpublic String[] getSupportedAdapterTypes(ContainerTypeDescription description)
IContainerInstantiatorIContainer.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 IContainerInstantiatorgetSupportedAdapterTypes in class BaseContainerInstantiatordescription - 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 Class[][] getSupportedParameterTypes(ContainerTypeDescription description)
IContainerInstantiatorIContainerInstantiator.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 IContainerInstantiatorgetSupportedParameterTypes in class BaseContainerInstantiatordescription - the ContainerTypeDescription to return parameter types forIContainerInstantiator.createInstance(ContainerTypeDescription, Object[]).
null returned if no parameter types supported for
given description.Copyright © 2004–2020 Eclipse Foundation. All rights reserved.