org.picocontainer.injectors
Class AnnotatedMethodInjection

java.lang.Object
  extended by org.picocontainer.injectors.AbstractInjectionFactory
      extended by org.picocontainer.injectors.AnnotatedMethodInjection
All Implemented Interfaces:
Serializable, ComponentFactory, InjectionFactory

public class AnnotatedMethodInjection
extends AbstractInjectionFactory

A InjectionFactory for Guice-style annotated methods. The factory creates AnnotatedMethodInjector.

Author:
Paul Hammant
See Also:
Serialized Form

Constructor Summary
AnnotatedMethodInjection()
           
AnnotatedMethodInjection(Class<? extends Annotation> injectionAnnotation, boolean useNames)
           
 
Method Summary
<T> ComponentAdapter<T>
createComponentAdapter(ComponentMonitor monitor, LifecycleStrategy lifecycleStrategy, Properties componentProperties, Object componentKey, Class<T> componentImplementation, Parameter... parameters)
          Create a SetterInjector.
 
Methods inherited from class org.picocontainer.injectors.AbstractInjectionFactory
accept, verify, wrapLifeCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotatedMethodInjection

public AnnotatedMethodInjection(Class<? extends Annotation> injectionAnnotation,
                                boolean useNames)

AnnotatedMethodInjection

public AnnotatedMethodInjection()
Method Detail

createComponentAdapter

public <T> ComponentAdapter<T> createComponentAdapter(ComponentMonitor monitor,
                                                      LifecycleStrategy lifecycleStrategy,
                                                      Properties componentProperties,
                                                      Object componentKey,
                                                      Class<T> componentImplementation,
                                                      Parameter... parameters)
                                           throws PicoCompositionException
Create a SetterInjector.

Parameters:
monitor -
lifecycleStrategy -
componentProperties -
componentKey - The component's key
componentImplementation - The class of the bean.
parameters - Any parameters for the setters. If null the adapter solves the dependencies for all setters internally. Otherwise the number parameters must match the number of the setter.
Returns:
Returns a new SetterInjector.
Throws:
PicoCompositionException - if dependencies cannot be solved or if the implementation is an interface or an abstract class.


Copyright © 2003-2010 Codehaus. All Rights Reserved.