public static class DefaultPicoContainer.KnowsContainerAdapter<T> extends Object implements ComponentAdapter<T>
ComponentAdapter.NOTHING| Constructor and Description |
|---|
DefaultPicoContainer.KnowsContainerAdapter(ComponentAdapter<T> ca,
PicoContainer ctr) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(PicoVisitor visitor)
Accepts a visitor for this ComponentAdapter.
|
<U extends ComponentAdapter> |
findAdapterOfType(Class<U> adapterType)
Locates a component adapter of type componentAdapterType in the ComponentAdapter chain.
|
Class<? extends T> |
getComponentImplementation()
Retrieve the class of the component.
|
T |
getComponentInstance(PicoContainer container)
Retrieve the component instance.
|
T |
getComponentInstance(PicoContainer container,
Type into)
Retrieve the component instance.
|
T |
getComponentInstance(Type into) |
Object |
getComponentKey()
Retrieve the key associated with the component.
|
ComponentAdapter |
getDelegate()
Component adapters may be nested in a chain, and this method is used to grab the next ComponentAdapter in the chain.
|
String |
getDescriptor()
Get a string key descriptor of the component adapter for use in toString()
|
void |
verify(PicoContainer container)
Verify that all dependencies for this adapter can be satisfied.
|
public DefaultPicoContainer.KnowsContainerAdapter(ComponentAdapter<T> ca, PicoContainer ctr)
public T getComponentInstance(Type into) throws PicoCompositionException
PicoCompositionExceptionpublic Object getComponentKey()
ComponentAdaptergetComponentKey in interface ComponentAdapter<T>public Class<? extends T> getComponentImplementation()
ComponentAdaptergetComponentImplementation in interface ComponentAdapter<T>public T getComponentInstance(PicoContainer container) throws PicoCompositionException
ComponentAdapterCached will always return the
same instance.getComponentInstance in interface ComponentAdapter<T>container - the PicoContainer, that is used to resolve any possible dependencies of the instance.PicoCompositionException - if the component has dependencies which could not be resolved, or
instantiation of the component lead to an ambigous situation within the
container.public T getComponentInstance(PicoContainer container, Type into) throws PicoCompositionException
ComponentAdapterCached will always return the
same instance.getComponentInstance in interface ComponentAdapter<T>container - the PicoContainer, that is used to resolve any possible dependencies of the instance.into - the class that is about to be injected into. Use ComponentAdapter.NOTHING.class if this is not important to you.PicoCompositionException - if the component has dependencies which could not be resolved, or
instantiation of the component lead to an ambiguous situation within the
container.public void verify(PicoContainer container) throws PicoCompositionException
ComponentAdapterverify in interface ComponentAdapter<T>container - the PicoContainer, that is used to resolve any possible dependencies of the instance.PicoCompositionException - if one or more dependencies cannot be resolved.public void accept(PicoVisitor visitor)
ComponentAdapterPicoContainer, that
cascades the visitor also down to all its ComponentAdapter instances.accept in interface ComponentAdapter<T>visitor - the visitor.public ComponentAdapter getDelegate()
ComponentAdaptergetDelegate in interface ComponentAdapter<T>public <U extends ComponentAdapter> U findAdapterOfType(Class<U> adapterType)
ComponentAdapterfindAdapterOfType in interface ComponentAdapter<T>U - the type of ComponentAdapter being located.adapterType - the class of the adapter type being located. Never null.public String getDescriptor()
ComponentAdaptergetDescriptor in interface ComponentAdapter<T>Copyright © 2003-2014 Codehaus. All Rights Reserved.