|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.picocontainer.adapters.AbstractAdapter
public abstract class AbstractAdapter
Base class for a ComponentAdapter with general functionality.
This implementation provides basic checks for a healthy implementation of a ComponentAdapter.
It does not allow to use null for the component key or the implementation,
ensures that the implementation is a concrete class and that the key is assignable from the
implementation if the key represents a type.
| Constructor Summary | |
|---|---|
AbstractAdapter(Object componentKey,
Class componentImplementation)
Constructs a new ComponentAdapter for the given key and implementation. |
|
AbstractAdapter(Object componentKey,
Class componentImplementation,
ComponentMonitor monitor)
Constructs a new ComponentAdapter for the given key and implementation. |
|
| Method Summary | |
|---|---|
void |
accept(PicoVisitor visitor)
Accepts a visitor for this ComponentAdapter. |
void |
changeMonitor(ComponentMonitor monitor)
Changes the component monitor used |
protected void |
checkTypeCompatibility()
|
ComponentMonitor |
currentMonitor()
Returns the monitor currently used |
ComponentAdapter |
findAdapterOfType(Class componentAdapterType)
|
Class |
getComponentImplementation()
Retrieve the class of the component. |
Object |
getComponentKey()
Retrieve the key associated with the component. |
ComponentAdapter |
getDelegate()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.picocontainer.ComponentAdapter |
|---|
getComponentInstance, verify |
| Constructor Detail |
|---|
public AbstractAdapter(Object componentKey,
Class componentImplementation)
componentKey - the search key for this implementationcomponentImplementation - the concrete implementation
public AbstractAdapter(Object componentKey,
Class componentImplementation,
ComponentMonitor monitor)
componentKey - the search key for this implementationcomponentImplementation - the concrete implementationmonitor - the component monitor used by this ComponentAdapter| Method Detail |
|---|
public Object getComponentKey()
getComponentKey in interface ComponentAdapterComponentAdapter.getComponentKey()public Class getComponentImplementation()
getComponentImplementation in interface ComponentAdapterComponentAdapter.getComponentImplementation()protected void checkTypeCompatibility()
public String toString()
toString in class ObjectObject.toString()public void accept(PicoVisitor visitor)
ComponentAdapterPicoContainer, that
cascades the visitor also down to all its ComponentAdapter instances.
accept in interface ComponentAdaptervisitor - the visitor.public void changeMonitor(ComponentMonitor monitor)
ComponentMonitorStrategy
changeMonitor in interface ComponentMonitorStrategymonitor - the new ComponentMonitor to usepublic ComponentMonitor currentMonitor()
currentMonitor in interface ComponentMonitorStrategypublic final ComponentAdapter getDelegate()
getDelegate in interface ComponentAdapterpublic final ComponentAdapter findAdapterOfType(Class componentAdapterType)
findAdapterOfType in interface ComponentAdapter
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||