|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.picocontainer.containers.CompositePicoContainer
public class CompositePicoContainer
CompositePicoContainer takes a var-args list of containers and will query them in turn for getComponent(*) and getComponentAdapter(*) requests. Methods returning lists and getParent/accept will not function.
Nested Class Summary | |
---|---|
class |
CompositePicoContainer.CompositeConverters
|
Constructor Summary | |
---|---|
CompositePicoContainer(PicoContainer... containers)
|
Method Summary | ||
---|---|---|
void |
accept(PicoVisitor visitor)
Accepts a visitor that should visit the child containers, component adapters and component instances. |
|
|
getComponent(Class<T> componentType)
Retrieve a component keyed by the component type. |
|
|
getComponent(Class<T> componentType,
Class<? extends Annotation> binding)
Retrieve a component keyed by the component type and binding type. |
|
Object |
getComponent(Object componentKeyOrType)
Retrieve a component instance registered with a specific key or type. |
|
Object |
getComponent(Object componentKeyOrType,
Type into)
|
|
|
getComponentAdapter(Class<T> componentType,
Class<? extends Annotation> binding)
Find a component adapter associated with the specified type and binding type. |
|
|
getComponentAdapter(Class<T> componentType,
NameBinding nameBinding)
Find a component adapter associated with the specified type and binding name. |
|
ComponentAdapter |
getComponentAdapter(Object componentKey)
Find a component adapter associated with the specified key. |
|
Collection<ComponentAdapter<?>> |
getComponentAdapters()
Retrieve all the component adapters inside this container. |
|
|
getComponentAdapters(Class<T> componentType)
Retrieve all component adapters inside this container that are associated with the specified type. |
|
|
getComponentAdapters(Class<T> componentType,
Class<? extends Annotation> binding)
Retrieve all component adapters inside this container that are associated with the specified type and binding type. |
|
List<Object> |
getComponents()
Retrieve all the registered component instances in the container, (not including those in the parent container). |
|
|
getComponents(Class<T> componentType)
Returns a List of components of a certain componentType. |
|
Converters |
getConverters()
Retrieve the set of converters for transforming string parameters into objects. |
|
PicoContainer |
getParent()
Retrieve the parent container of this container. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CompositePicoContainer(PicoContainer... containers)
Method Detail |
---|
public <T> T getComponent(Class<T> componentType)
PicoContainer
getComponent
in interface PicoContainer
componentType
- the type of the component
public Object getComponent(Object componentKeyOrType, Type into)
getComponent
in interface PicoContainer
public Object getComponent(Object componentKeyOrType)
PicoContainer
getComponent
in interface PicoContainer
componentKeyOrType
- the key or Type that the component was registered with.
null
if no component has been registered for the specified
key.public ComponentAdapter getComponentAdapter(Object componentKey)
PicoContainer
getComponentAdapter
in interface PicoContainer
componentKey
- the key that the component was registered with.
null
if no component has been
registered for the specified key.public <T> ComponentAdapter<T> getComponentAdapter(Class<T> componentType, NameBinding nameBinding)
PicoContainer
getComponentAdapter
in interface PicoContainer
componentType
- the type of the component.nameBinding
- the name binding to use
null
if no component has been
registered for the specified key.public <T> ComponentAdapter<T> getComponentAdapter(Class<T> componentType, Class<? extends Annotation> binding)
PicoContainer
getComponentAdapter
in interface PicoContainer
componentType
- the type of the component.binding
- the typed binding to use
null
if no component has been
registered for the specified key.public <T> T getComponent(Class<T> componentType, Class<? extends Annotation> binding)
PicoContainer
getComponent
in interface PicoContainer
componentType
- the type of the componentbinding
- the binding type of the component
public List<Object> getComponents()
PicoContainer
getComponents
in interface PicoContainer
public PicoContainer getParent()
PicoContainer
getParent
in interface PicoContainer
PicoContainer
instance, or null
if this container does not have a parent.public Collection<ComponentAdapter<?>> getComponentAdapters()
PicoContainer
getComponentAdapters
in interface PicoContainer
ComponentAdapter
s inside this container. The collection will not
be modifiable.a variant of this method which returns the component adapters inside this
container that are associated with the specified type.
public <T> List<ComponentAdapter<T>> getComponentAdapters(Class<T> componentType)
PicoContainer
getComponentAdapters
in interface PicoContainer
componentType
- the type of the components.
ComponentAdapter
s inside this container that are associated with
the specified type. Changes to this collection will not be reflected in the container itself.public <T> List<ComponentAdapter<T>> getComponentAdapters(Class<T> componentType, Class<? extends Annotation> binding)
PicoContainer
getComponentAdapters
in interface PicoContainer
componentType
- the type of the components.binding
- the typed binding to use
ComponentAdapter
s inside this container that are associated with
the specified type. Changes to this collection will not be reflected in the container itself.public <T> List<T> getComponents(Class<T> componentType)
PicoContainer
getComponents
in interface PicoContainer
componentType
- the searched type.
public void accept(PicoVisitor visitor)
PicoContainer
accept
in interface PicoContainer
visitor
- the visitorpublic Converters getConverters()
Converting
getConverters
in interface Converting
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |