|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.picocontainer.defaults.MonitoringComponentAdapter
org.picocontainer.defaults.AbstractComponentAdapter
public abstract class AbstractComponentAdapter
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 | |
---|---|
protected |
AbstractComponentAdapter(Object componentKey,
Class componentImplementation)
Constructs a new ComponentAdapter for the given key and implementation. |
protected |
AbstractComponentAdapter(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. |
protected void |
checkTypeCompatibility()
|
Class |
getComponentImplementation()
Retrieve the class of the component. |
Object |
getComponentKey()
Retrieve the key associated with the component. |
String |
toString()
|
Methods inherited from class org.picocontainer.defaults.MonitoringComponentAdapter |
---|
changeMonitor, currentMonitor |
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 |
---|
protected AbstractComponentAdapter(Object componentKey, Class componentImplementation) throws AssignabilityRegistrationException
componentKey
- the search key for this implementationcomponentImplementation
- the concrete implementation
AssignabilityRegistrationException
- if the key is a type and the implementation cannot be assigned to.protected AbstractComponentAdapter(Object componentKey, Class componentImplementation, ComponentMonitor monitor) throws AssignabilityRegistrationException
componentKey
- the search key for this implementationcomponentImplementation
- the concrete implementationmonitor
- the component monitor used by this ComponentAdapter
AssignabilityRegistrationException
- if the key is a type and the implementation cannot be assigned to.Method Detail |
---|
public Object getComponentKey()
ComponentAdapter.getComponentKey()
public Class getComponentImplementation()
ComponentAdapter.getComponentImplementation()
protected void checkTypeCompatibility() throws AssignabilityRegistrationException
AssignabilityRegistrationException
public String toString()
toString
in class Object
Object.toString()
public void accept(PicoVisitor visitor)
ComponentAdapter
PicoContainer
, that
cascades the visitor also down to all its ComponentAdapter instances.
visitor
- the visitor.
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |