org.picocontainer.defaults
Class ConstantParameter

java.lang.Object
  extended byorg.picocontainer.defaults.ConstantParameter
All Implemented Interfaces:
Parameter, Serializable

public class ConstantParameter
extends Object
implements Parameter, Serializable

A ConstantParameter should be used to pass in "constant" arguments to constructors. This includes Strings, Integers or any other object that is not registered in the container.

Version:
$Revision: 1.19 $
Author:
Jon Tirsén, Aslak Hellesøy, Jörg Schaible
See Also:
Serialized Form

Constructor Summary
ConstantParameter(Object value)
           
 
Method Summary
 ComponentAdapter resolveAdapter(PicoContainer picoContainer, Class expectedType)
          Retrieve the component adapter that should be used to find the instance to be passed in for this parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstantParameter

public ConstantParameter(Object value)
Method Detail

resolveAdapter

public ComponentAdapter resolveAdapter(PicoContainer picoContainer,
                                       Class expectedType)
                                throws AssignabilityRegistrationException,
                                       NotConcreteRegistrationException
Description copied from interface: Parameter
Retrieve the component adapter that should be used to find the instance to be passed in for this parameter.

Specified by:
resolveAdapter in interface Parameter
Parameters:
picoContainer - the container from which dependencies are resolved.
expectedType - the type that the returned adapter needs to provide.
Returns:
the component adapter that should be used to find the instance to be passed in for this parameter. Should return null if not suitable adapter can be found.
Throws:
AssignabilityRegistrationException
NotConcreteRegistrationException


Copyright © 2003-2004 Codehaus. All Rights Reserved.