org.picocontainer.defaults
Class BeanPropertyComponentAdapter

java.lang.Object
  extended byorg.picocontainer.defaults.DecoratingComponentAdapter
      extended byorg.picocontainer.defaults.BeanPropertyComponentAdapter
All Implemented Interfaces:
ComponentAdapter, Serializable

public class BeanPropertyComponentAdapter
extends DecoratingComponentAdapter

Decorating component adapter that can be used to set additional properties on a component. These properties must be managed manually by the user of the API, and will not be managed by PicoContainer. This class is therefore not the same as SetterInjectionComponentAdapter, which is a true Setter Injection adapter.

This adapter is mostly handy for setting various primitive properties via setters.

Note that this class doesn't cache instances. If you want caching, use a CachingComponentAdapter around this one.

Version:
$Revision: 1.7 $
Author:
Aslak Hellesøy
See Also:
Serialized Form

Constructor Summary
BeanPropertyComponentAdapter(ComponentAdapter delegate)
           
 
Method Summary
 Object getComponentInstance()
          Retrieve the component instance.
 void setProperties(Map properties)
          Sets the bean property values that should be set upon creation.
 
Methods inherited from class org.picocontainer.defaults.DecoratingComponentAdapter
getComponentImplementation, getComponentKey, getContainer, getDelegate, setContainer, verify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanPropertyComponentAdapter

public BeanPropertyComponentAdapter(ComponentAdapter delegate)
                             throws PicoInitializationException
Method Detail

getComponentInstance

public Object getComponentInstance()
                            throws PicoInitializationException,
                                   PicoIntrospectionException,
                                   AssignabilityRegistrationException,
                                   NotConcreteRegistrationException
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, CachingComponentAdapter will always return the same instance.

Specified by:
getComponentInstance in interface ComponentAdapter
Overrides:
getComponentInstance in class DecoratingComponentAdapter
Throws:
PicoInitializationException
PicoIntrospectionException
AssignabilityRegistrationException
NotConcreteRegistrationException

setProperties

public void setProperties(Map properties)
Sets the bean property values that should be set upon creation.

Parameters:
properties - bean properties


Copyright © 2003-2004 Codehaus. All Rights Reserved.