public interface Container
| Modifier and Type | Method and Description |
|---|---|
<T> void |
addComponent(Class<T> componentType)
Register a component type.
|
void |
addComponent(Object componentKey,
Object implementation)
Register a component.
|
Container |
createChildContainer()
Creates a child container.
|
void |
dispose()
Disposes of the container and all of its child containers.
|
<T> Class<T> |
getClass(String className,
Class<T> superType)
Returns a class given its name.
|
<T> T |
getComponent(Class<T> componentType)
Retrieve a component by its component type.
|
Object |
getComponent(Object componentKeyOrType)
Retrieve a component by its component key or type.
|
boolean |
removeChildContainer(Container child)
Removes a child container.
|
<T> void addComponent(Class<T> componentType)
componentType - the component typeContainerException - if registration failsvoid addComponent(Object componentKey, Object implementation)
componentKey - the component identifier. This must be unique within the containerimplementation - the component implementationContainerException - if registration fails<T> T getComponent(Class<T> componentType)
componentType - the type of the componentContainerException - if component creation failsObject getComponent(Object componentKeyOrType)
componentKeyOrType - the key or type of the componentContainerException - if component creation failsContainer createChildContainer()
ContainerException - if creation failsboolean removeChildContainer(Container child)
child - the container to removevoid dispose()
<T> Class<T> getClass(String className, Class<T> superType)
className - the class namesuperType - the super typeClassCastException - if className does not implement or extend superTypeIzPackClassNotFoundException - if the class cannot be foundCopyright © 2001–2025. All rights reserved.