org.picocontainer.defaults
Class ConstructorComponentAdapter

java.lang.Object
  extended byorg.picocontainer.defaults.AbstractComponentAdapter
      extended byorg.picocontainer.defaults.InstantiatingComponentAdapter
          extended byorg.picocontainer.defaults.ConstructorComponentAdapter
All Implemented Interfaces:
ComponentAdapter, java.io.Serializable

public class ConstructorComponentAdapter
extends InstantiatingComponentAdapter

Instantiates components using Constructor-Based Dependency Injection. {@inheritDoc}

Version:
$Revision: 1.14 $
Author:
Aslak Hellesøy, Paul Hammant, Jon Tirsén, Zohar Melamed
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.picocontainer.defaults.InstantiatingComponentAdapter
parameters
 
Constructor Summary
ConstructorComponentAdapter(java.lang.Object componentKey, java.lang.Class componentImplementation)
          Use default parameters.
ConstructorComponentAdapter(java.lang.Object componentKey, java.lang.Class componentImplementation, Parameter[] parameters)
          Explicitly specifies parameters, if null uses default parameters.
 
Method Summary
protected  java.lang.Object[] getConstructorArguments(ComponentAdapter[] adapterDependencies)
           
protected  java.lang.reflect.Constructor getGreediestSatisifableConstructor(PicoContainer dependencyContainer)
           
protected  java.lang.Class[] getMostSatisfiableDependencyTypes(PicoContainer dependencyContainer)
           
 
Methods inherited from class org.picocontainer.defaults.InstantiatingComponentAdapter
createDefaultParameters, getComponentInstance, instantiateComponent, verify
 
Methods inherited from class org.picocontainer.defaults.AbstractComponentAdapter
getComponentImplementation, getComponentKey, getContainer, setContainer, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConstructorComponentAdapter

public ConstructorComponentAdapter(java.lang.Object componentKey,
                                   java.lang.Class componentImplementation,
                                   Parameter[] parameters)
                            throws AssignabilityRegistrationException,
                                   NotConcreteRegistrationException
Explicitly specifies parameters, if null uses default parameters. {@inheritDoc}


ConstructorComponentAdapter

public ConstructorComponentAdapter(java.lang.Object componentKey,
                                   java.lang.Class componentImplementation)
                            throws AssignabilityRegistrationException,
                                   NotConcreteRegistrationException
Use default parameters. {@inheritDoc}

Method Detail

getMostSatisfiableDependencyTypes

protected java.lang.Class[] getMostSatisfiableDependencyTypes(PicoContainer dependencyContainer)
                                                       throws PicoIntrospectionException,
                                                              AmbiguousComponentResolutionException,
                                                              AssignabilityRegistrationException,
                                                              NotConcreteRegistrationException
Specified by:
getMostSatisfiableDependencyTypes in class InstantiatingComponentAdapter
Throws:
PicoIntrospectionException
AmbiguousComponentResolutionException
AssignabilityRegistrationException
NotConcreteRegistrationException

getGreediestSatisifableConstructor

protected java.lang.reflect.Constructor getGreediestSatisifableConstructor(PicoContainer dependencyContainer)
                                                                    throws PicoIntrospectionException,
                                                                           UnsatisfiableDependenciesException,
                                                                           AmbiguousComponentResolutionException,
                                                                           AssignabilityRegistrationException,
                                                                           NotConcreteRegistrationException
Specified by:
getGreediestSatisifableConstructor in class InstantiatingComponentAdapter
Throws:
PicoIntrospectionException
UnsatisfiableDependenciesException
AmbiguousComponentResolutionException
AssignabilityRegistrationException
NotConcreteRegistrationException

getConstructorArguments

protected java.lang.Object[] getConstructorArguments(ComponentAdapter[] adapterDependencies)
Specified by:
getConstructorArguments in class InstantiatingComponentAdapter


Copyright © 2003-2004 Codehaus. All Rights Reserved.