org.picocontainer.adapters
Class NullCA

java.lang.Object
  extended by org.picocontainer.adapters.NullCA
All Implemented Interfaces:
ComponentAdapter

public class NullCA
extends Object
implements ComponentAdapter


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.picocontainer.ComponentAdapter
ComponentAdapter.NOTHING
 
Constructor Summary
NullCA(Object key)
           
 
Method Summary
 void accept(PicoVisitor visitor)
          Accepts a visitor for this ComponentAdapter.
 ComponentAdapter findAdapterOfType(Class componentAdapterType)
          Locates a component adapter of type componentAdapterType in the ComponentAdapter chain.
 Class getComponentImplementation()
          Retrieve the class of the component.
 Object getComponentInstance(PicoContainer container)
          Retrieve the component instance.
 Object getComponentInstance(PicoContainer container, Type into)
          Retrieve the component instance.
 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.
 void verify(PicoContainer container)
          Verify that all dependencies for this adapter can be satisfied.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullCA

public NullCA(Object key)
Method Detail

getComponentKey

public Object getComponentKey()
Description copied from interface: ComponentAdapter
Retrieve the key associated with the component.

Specified by:
getComponentKey in interface ComponentAdapter
Returns:
the component's key. Should either be a class type (normally an interface) or an identifier that is unique (within the scope of the current PicoContainer).

getComponentImplementation

public Class getComponentImplementation()
Description copied from interface: ComponentAdapter
Retrieve the class of the component.

Specified by:
getComponentImplementation in interface ComponentAdapter
Returns:
the component's implementation class. Should normally be a concrete class (ie, a class that can be instantiated).

getComponentInstance

public Object getComponentInstance(PicoContainer container)
Description copied from interface: ComponentAdapter
Retrieve the component instance. This method will usually create a new instance each time it is called, but that is not required. For example, Cached will always return the same instance.

Specified by:
getComponentInstance in interface ComponentAdapter
Parameters:
container - the PicoContainer, that is used to resolve any possible dependencies of the instance.
Returns:
the component instance.

getComponentInstance

public Object getComponentInstance(PicoContainer container,
                                   Type into)
Description copied from interface: ComponentAdapter
Retrieve the component instance. This method will usually create a new instance each time it is called, but that is not required. For example, Cached will always return the same instance.

Specified by:
getComponentInstance in interface ComponentAdapter
Parameters:
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.
Returns:
the component instance.

verify

public void verify(PicoContainer container)
Description copied from interface: ComponentAdapter
Verify that all dependencies for this adapter can be satisfied. Normally, the adapter should verify this by checking that the associated PicoContainer contains all the needed dependencies.

Specified by:
verify in interface ComponentAdapter
Parameters:
container - the PicoContainer, that is used to resolve any possible dependencies of the instance.

accept

public void accept(PicoVisitor visitor)
Description copied from interface: ComponentAdapter
Accepts a visitor for this ComponentAdapter. The method is normally called by visiting a PicoContainer, that cascades the visitor also down to all its ComponentAdapter instances.

Specified by:
accept in interface ComponentAdapter
Parameters:
visitor - the visitor.

getDelegate

public ComponentAdapter getDelegate()
Description copied from interface: ComponentAdapter
Component adapters may be nested in a chain, and this method is used to grab the next ComponentAdapter in the chain.

Specified by:
getDelegate in interface ComponentAdapter
Returns:
the next component adapter in line or null if there is no delegate ComponentAdapter.

findAdapterOfType

public ComponentAdapter findAdapterOfType(Class componentAdapterType)
Description copied from interface: ComponentAdapter
Locates a component adapter of type componentAdapterType in the ComponentAdapter chain. Will return null if there is no adapter of the given type.

Specified by:
findAdapterOfType in interface ComponentAdapter
Parameters:
componentAdapterType - the class of the adapter type being located. Never null.
Returns:
the appropriate component adapter of type U. May return null if the component adapter type is not returned.

getDescriptor

public String getDescriptor()
Description copied from interface: ComponentAdapter
Get a string key descriptor of the component adapter.

Specified by:
getDescriptor in interface ComponentAdapter
Returns:


Copyright © 2003-2010 Codehaus. All Rights Reserved.